Question 41

Computer Awareness Sorting Easy

The Quicksort and randomized Quicksort procedures differ in:

(A) Selection of Pivot element
(B) Worst case time complexity
(C) Best case time Complexity
(D) Final Output
View Dynamic Solution & Explanation
Correct Solution: Option A

Step-by-step Solution:

Solution

Both Quicksort and Randomized Quicksort are divide-and-conquer sorting algorithms. The key difference lies in how the pivot element is chosen:

  • Quicksort: Typically selects a fixed element (e.g., first, last, or middle) as the pivot.
  • Randomized Quicksort: Selects the pivot randomly from the array, reducing the probability of worst-case performance.

Other characteristics such as final output or time complexities may vary, but the defining distinction is the selection of the pivot element.

Correct Option: (A) Selection of Pivot element