On which algorithm is heap sort based on?
A. Fibonacci heap
B. Binary tree
C. Priority queue
D. FIFO
Select an option to see the answer and solution.
Which of the following is not true about QuickSort?
A. in-place algorithm
B. pivot position can be changed
C. adaptive sorting algorithm
D. can be implemented as a stable sort
Select an option to see the answer and solution.
What is the average case time complexity of tree sort?
A. O(n)
B. O(n log n)
C. O(n2 )
D. O(log n)
Select an option to see the answer and solution.
Which of the following is an advantage of recursive insertion sort over its iterative version?
A. it has better time complexity
B. it has better space complexity
C. it is easy to implement
D. it has no significant advantage
Select an option to see the answer and solution.
Consider the following statements related to the binary tree sort.
I. Element can be added gradually as they become available
II. It needs extra memory space
A. Statement I is true but Statement II is false
B. Both Statement I and Statement II are false
C. Both Statement I and Statement II are true
D. Statement II is true but Statement I is false
Select an option to see the answer and solution.
What is the average time complexity of Tim sort?
A. O(n)
B. O(n log n)
C. O(n2 )
D. O(log n)
Select an option to see the answer and solution.
What is a randomized QuickSort?
A. The leftmost element is chosen as the pivot
B. The rightmost element is chosen as the pivot
C. Any element in the array is chosen as the pivot
D. A random number is generated which is used as the pivot
Select an option to see the answer and solution.
Which of the following is not an exchange sort?
A. Bubble Sort
B. Quick Sort
C. Partition-exchange Sort
D. Insertion Sort
Select an option to see the answer and solution.
Stooge sort is a comparison based sorting algorithm.
Select an option to see the answer and solution.
Bead sort is only applicable to positive integers.
Select an option to see the answer and solution.
What will be the number of passes to sort the elements using insertion sort?
14, 12,16, 6, 3, 10
Select an option to see the answer and solution.
Which of the following is incorrect about randomized quicksort?
A. it has the same time complexity as standard quick sort
B. it has the same space complexity as standard quick sort
C. it is an in-place sorting algorithm
D. it cannot have a time complexity of O(n2 ) in any case.
Select an option to see the answer and solution.
Which of the following is an alternate name of library sort?
A. gapped insertion sort
B. binary insertion sort
C. recursive insertion sort
D. binary gap sort
Select an option to see the answer and solution.
Which of the following traversal in a binary search tree results in a sorted output?
A. in order traversal
B. pre order traversal
C. post order traversal
D. breadth first traversal
Select an option to see the answer and solution.
What is the best case time complexity of Tim sort?
A. O(n)
B. O(n log n)
C. O(n2 )
D. O(log n)
Select an option to see the answer and solution.
What is the advantage of counting sort over quick sort?
A. counting sort has lesser time complexity when range is comparable to number of input elements
B. counting sort has lesser space complexity
C. counting sort is not a comparison based sorting technique
D. it has no advantage
Select an option to see the answer and solution.
What is the worst case time complexity of bead sort (S= sum of input elements)?
A. O(n)
B. O(S)
C. O(n2 )
D. O(n log n)
Select an option to see the answer and solution.
What is the best case time complexity of bead sort (S = sum of input elements)?
A. O(n)
B. O(S)
C. O(n2 )
D. O(n log n)
Select an option to see the answer and solution.
LSD radix sort requires . . . . . . . . passes to sort N elements.
A. (w/logR)
B. N(w/logR)
C. (w/log(RN))
D. (wN/log(N))
Select an option to see the answer and solution.
What is a randomized quick sort?
A. quick sort with random partitions
B. quick sort with random choice of pivot
C. quick sort with random output
D. quick sort with random input
Select an option to see the answer and solution.