Q. In Quick Sort, what is the role of the pivot?
-
A.
To divide the array
-
B.
To sort the array
-
C.
To merge the array
-
D.
To find the maximum element
Solution
In Quick Sort, the pivot is used to divide the array into two parts: elements less than the pivot and elements greater than the pivot.
Correct Answer:
A
— To divide the array
Learn More →
Q. What is the average time complexity of Quick Sort?
-
A.
O(n log n)
-
B.
O(n^2)
-
C.
O(log n)
-
D.
O(n)
Solution
The average time complexity of Quick Sort is O(n log n) due to its divide-and-conquer approach.
Correct Answer:
A
— O(n log n)
Learn More →
Showing 1 to 2 of 2 (1 Pages)