Q. In which scenario is Quick Sort preferred over Merge Sort?
-
A.
When memory usage is a concern
-
B.
When stability is required
-
C.
When the data is nearly sorted
-
D.
When the data is large and random
Solution
Quick Sort is preferred when memory usage is a concern because it is an in-place sorting algorithm.
Correct Answer:
A
— When memory usage is a concern
Learn More →
Q. What is the primary advantage of Merge Sort over Quick Sort?
-
A.
Faster for small datasets
-
B.
In-place sorting
-
C.
Stable sorting
-
D.
Lower average time complexity
Solution
The primary advantage of Merge Sort is that it is a stable sorting algorithm, maintaining the relative order of equal elements.
Correct Answer:
C
— Stable sorting
Learn More →
Showing 1 to 2 of 2 (1 Pages)