Which of the following statements about Quick Sort is true?
Practice Questions
Q1
Which of the following statements about Quick Sort is true?
It is stable
It can be implemented using a linked list
It always selects the median as pivot
It has a worst-case time complexity of O(n log n)
Questions & Step-by-Step Solutions
Which of the following statements about Quick Sort is true?
Step 1: Understand what Quick Sort is. Quick Sort is a sorting algorithm that works by selecting a 'pivot' element from the array and partitioning the other elements into two sub-arrays according to whether they are less than or greater than the pivot.
Step 2: Learn about linked lists. A linked list is a data structure where each element (node) points to the next one, allowing for efficient insertions and deletions.
Step 3: Know that Quick Sort can be applied to different data structures, including arrays and linked lists. This means you can sort a linked list using Quick Sort.
Step 4: Understand the concept of stability in sorting algorithms. A stable sorting algorithm maintains the relative order of records with equal keys. Quick Sort is not stable because it can change the order of equal elements.
Step 5: Learn about the pivot selection in Quick Sort. The pivot can be chosen in various ways (first element, last element, random element, etc.), but it does not always select the median value, which is the middle value in a sorted list.