Q. What is a real-world application of Heap Sort?
-
A.
Sorting a small list of names
-
B.
Implementing a priority queue
-
C.
Sorting data in a database
-
D.
Real-time data processing
Solution
Heap Sort is often used in implementing priority queues due to its efficient handling of dynamic data.
Correct Answer:
B
— Implementing a priority queue
Learn More →
Q. What is the average time complexity of Merge Sort?
-
A.
O(n)
-
B.
O(n log n)
-
C.
O(n^2)
-
D.
O(log n)
Solution
Merge Sort has an average time complexity of O(n log n) due to its recursive division of the array.
Correct Answer:
B
— O(n log n)
Learn More →
Q. What is the primary advantage of using Quick Sort over other algorithms?
-
A.
Simplicity
-
B.
In-place sorting
-
C.
Stability
-
D.
Low memory usage
Solution
The primary advantage of Quick Sort is that it sorts in place, requiring minimal additional memory.
Correct Answer:
B
— In-place sorting
Learn More →
Q. Which sorting algorithm is not in-place?
-
A.
Quick Sort
-
B.
Merge Sort
-
C.
Heap Sort
-
D.
Insertion Sort
Solution
Merge Sort is not an in-place sorting algorithm as it requires additional space for merging.
Correct Answer:
B
— Merge Sort
Learn More →
Showing 1 to 4 of 4 (1 Pages)