Comb Sort Multiple choice Questions and Answers (MCQs)
Comb sort is an improved version of .....
Question 1 Explanation:
Comb sort compares two elements at a variable gap from each other in each iteration unlike bubble sort where the gap remains 1. This reduces the average time complexity of comb sort.
The gap between two elements being compared shrinks by a factor of ..... after every iteration.
Question 2 Explanation:
It has been found experimentally that the gap between the two elements should shrink by a factor of 1.3 after each iteration for the most efficient sorting.
The initial gap between two elements being compared .....
is equal to number of elements in the array
is equal to 1.3
depends on the number of iterations
depends on the compiler being used
Question 3 Explanation:
Initial gap is taken to be equal to the number of elements in the array and shrinks by a factor of 1.3 in each iteration, initial gap is independent of the number of iterations and compiler being used.
What is the worst case time complexity of comb sort?
O(n log n)
O(n2/2a) (a=number of increment)
Question 4 Explanation:
Worst case complexity is observed when the input array is reverse sorted. This is same as the worst case complexity of bubble sort.
The gap value after 3 iterations in an array with 6 elements will be .....
Question 5 Explanation:
Initially the gap value will be 6. For the first iteration, it will be 6/1.3=4 then 4/1.3=3 for second iteration and 3/1.3=2 for the third iteration.
There are 5 questions to complete.