DS – mcq on Sorting
The following are the objective questions on the topic related to Sorting in data structures using C/C++.
1. Which of the following is not a non comparison sort?
- Counting sort
- Bucket sort
- Radix sort
- Shell sort
Answer: D
2. The time complexity of heap sort in worst case is___
- O(logn)
- O(n)
- O(nlogn)
- O(n2)
Answer: C
3.In a binary max heap containing n numbers, the smallest element can be found in time_.
- θ (n)
- θ (logn)
- θ (loglogn)
- θ (1)
Answer:A
4.The running time for creating a heap of size n is
- O (n)
- O (log n)
- O (n log n)
- O (n2)
Answer: C
5.Finding the location of a given item in a collection of items is called ……
- Discovering
- Finding
- Searching
- Mining
Answer:C
6.Which of the following is an external sorting?
- Insertion Sort
- Bubble Sort
- Merge Sort
- Tree Sort
Answer: C
7.The function used to modify the way of sorting the keys of records is called ……..
- Indexing function
- Hash function
- Addressing function
- All of the above
Answer: B
8.The complexity of bubble sort algorithm is …..
- O(n)
- O(logn)
- O(n2)
- O(n logn)
Answer:C
9.Bubble sort sometimes referred to as _____________.
- binding sort.
- sinking sort.
- skip sort.
- none of these.
Answer: B
10.The worst complexity of bubble sort is ________.
- O(n2).
- O(nlogn)
- O(n)
- O(n+1)
Answer: A
11.The bubble sort algorithm compares each pair of adjacent___________ and swaps them if they are in wrong order.
- items
- nodes
- links
- none
Answer: A
12.The best complexity of bubble sort is _____
- O(n2)
- O(nlogn)
- O(n)
- O(n+1)
Answer: C