Q. What is the primary application of Heap Sort?
-
A.
Sorting linked lists
-
B.
Priority queue implementation
-
C.
Searching algorithms
-
D.
Graph algorithms
Solution
Heap Sort is primarily used for implementing priority queues due to its efficient heap structure.
Correct Answer:
B
— Priority queue implementation
Learn More →
Q. What is the time complexity of the best-case scenario for Insertion Sort?
-
A.
O(n log n)
-
B.
O(n^2)
-
C.
O(n)
-
D.
O(log n)
Solution
The best-case time complexity for Insertion Sort is O(n) when the array is already sorted.
Correct Answer:
C
— O(n)
Learn More →
Q. Which of the following is a characteristic of Merge Sort?
-
A.
In-place sorting
-
B.
Not stable
-
C.
Divides the array into halves
-
D.
Uses a single pivot
Solution
Merge Sort divides the array into halves recursively before merging them back together.
Correct Answer:
C
— Divides the array into halves
Learn More →
Q. Which sorting algorithm has the best average-case performance?
-
A.
Bubble Sort
-
B.
Quick Sort
-
C.
Selection Sort
-
D.
Insertion Sort
Solution
Quick Sort has the best average-case performance among the listed algorithms with O(n log n).
Correct Answer:
B
— Quick Sort
Learn More →
Showing 1 to 4 of 4 (1 Pages)