21
Binary search can be used in an insertion sort algorithm to reduce the number of comparisons.
A)
True
B)
False
Answer & Solution
Answer: Option
A
22
What is the worst case time complexity of gnome sort?
A)
O(n)
B)
O(n2 )
C)
O(n log n)
D)
O(log n)
Answer & Solution
Answer: Option
B
23
What is the worst case time complexity of merge sort?
A)
O(n log n)
B)
O(n2 )
C)
O(n2 log n)
D)
O(n log n2 )
Answer & Solution
Answer: Option
A
24
Introsort begins sorting the given array by using which of the following sorting algorithm?
A)
selection sort
B)
quick sort
C)
insertion sort
D)
heap sort
Answer & Solution
Answer: Option
B
25
Quick Sort is a . . . . . . . .
A)
greedy algorithm
B)
divide and conquer algorithm
C)
dynamic programming algorithm
D)
backtracking algorithm
Answer & Solution
Answer: Option
B
26
What is the worst space complexity of bucket sort (k = number of buckets)?
A)
O(n + k)
B)
O(n.k)
C)
O(n2 )
D)
O(n log n)
Answer & Solution
Answer: Option
B
27
How many odd and even phases are required respectively to sort the given array using odd-even sort.arr={3, 2, 3, 8, 5, 6, 2, 1}.
A)
3,3
B)
4,4
C)
3,4
D)
4,3
Answer & Solution
Answer: Option
B
28
How many loops are required to implement gnome sorting algorithm?
A)
Single loop
B)
2 nested loops
C)
3 nested loops
D)
It does not require any loop
Answer & Solution
Answer: Option
A
29
Which of the following is a disadvantage of cube sort?
A)
high memory overhead for small data
B)
high memory overhead for any data
C)
balancing is slow
D)
Iteration is slow
Answer & Solution
Answer: Option
A
30
Which of the following is not an alternative name of permutation sort?
A)
stupid sort
B)
bogo sort
C)
donkey sort
D)
monkey sort
Answer & Solution
Answer: Option
C