Q. In which scenario is Quick Sort generally preferred over Merge Sort?
-
A.
When memory usage is a concern
-
B.
When the data is nearly sorted
-
C.
When stability is required
-
D.
When the data is small
Solution
Quick Sort is generally preferred over Merge Sort when memory usage is a concern, as it is an in-place sorting algorithm.
Correct Answer:
A
— When memory usage is a concern
Learn More →
Q. What is the best-case time complexity of Insertion Sort?
-
A.
O(n log n)
-
B.
O(n^2)
-
C.
O(n)
-
D.
O(log n)
Solution
The best-case time complexity of Insertion Sort is O(n) when the array is already sorted.
Correct Answer:
C
— O(n)
Learn More →
Showing 1 to 2 of 2 (1 Pages)