# Sorting Algorithm Quiz - Quick Sort

Approved & Edited by ProProfs Editorial Team
At ProProfs Quizzes, our dedicated in-house team of experts takes pride in their work. With a sharp eye for detail, they meticulously review each quiz. This ensures that every quiz, taken by over 100 million users, meets our standards of accuracy, clarity, and engagement.
| Written by RosyU
R
RosyU
Community Contributor
Quizzes Created: 6 | Total Attempts: 40,321
Questions: 5 | Attempts: 3,081  Settings  Quicksort is an in-place sorting algorithm. Developed by British computer scientist Tony Hoare in 1959 and published in 1961, it is still a commonly used algorithm for sorting. When implemented well, it can be somewhat faster than merge sort and about two or three times faster than heapsort

• 1.

### What are the correct intermediate steps of the following data set when it is being sorted with the Quick sort? 15,20,10,18

• A.

15,10,20,18 -- 15,10,18,20 -- 10,15,18,20

• B.

15,20,10,18 -- 15,10,20,18 -- 10,15,20,18

• C.

10, 20,15,18 -- 10,15,20,18 -- 10,15,18,20

• D.

10, 20,15,18 -- 10,18,15,20 -- 10,15,18,20

D. 10, 20,15,18 -- 10,18,15,20 -- 10,15,18,20
Explanation
The given answer shows the correct intermediate steps of the data set being sorted with the Quick sort algorithm. The first step is to partition the array around a pivot element, which in this case is 10. After partitioning, the array becomes 10, 20, 15, 18. Then, the same process is applied to the two sub-arrays formed by the partition. The next pivot element is 15, and after partitioning, the array becomes 10, 18, 15, 20. Finally, the last pivot element is 18, and after partitioning, the array becomes 10, 15, 18, 20, which is the sorted array.

Rate this question:

• 2.

### Quick sort uses

• A.

Exchanging

• B.

Partitioning

• C.

Selection

• D.

Merging

B. Partitioning
Explanation
Quick sort uses partitioning to divide the input array into two sub-arrays, one with elements smaller than a chosen pivot and the other with elements larger than the pivot. This process is repeated recursively on each sub-array until the entire array is sorted. Partitioning is a crucial step in the quick sort algorithm as it determines the position of the pivot element and helps in efficiently sorting the array.

Rate this question:

• 3.

### Using quick sort is a stable way of sorting

• A.

True

• B.

False

B. False
Explanation
Quick sort is not a stable way of sorting. Stability in sorting means that the relative order of equal elements is preserved in the sorted output. In quick sort, the elements are partitioned based on a pivot, and the order of equal elements may change during the partitioning process. Therefore, quick sort does not guarantee stability in sorting.

Rate this question:

• 4.

### "Divide-and-conquer" refers to:

• A.

The list being divided into sublists with equal numbers of elements in each, then those sorted sublists are merged back together.

• B.

The list being divided into only two sublists, never more or less, which are sorted and merged back together.

• C.

The list being divided into smaller sublists, then those sorted sublists are merged back together.

C. The list being divided into smaller sublists, then those sorted sublists are merged back together.
Explanation
"Divide-and-conquer" is a problem-solving technique that involves breaking down a problem into smaller subproblems, solving them independently, and then combining the solutions to solve the original problem. In the context of the given options, the correct answer states that the list is divided into smaller sublists, which implies that the original problem is being divided into smaller subproblems. These sublists are then sorted independently, representing the solving of the subproblems, and finally merged back together, representing the combination of the solutions to solve the original problem.

Rate this question:

• 5.

### In this sequence, 11 4 20 45 32 60 98 70, which element seems to be the pivot?

• A.

70

• B.

20

• C.

98

• D.

4 Back to top