Computer scienceAlgorithms and Data StructuresAlgorithmsArray algorithmsSorting algorithms

Quick sort

What was a pivot

Report a typo

To implement the quicksort algorithm, various rules of choosing the pivot can be used.

The partition operation can also be implemented in many ways.

Suppose you have the following array:

{ 12, 3, 7, 55, 27, 18, 44, 2 }

Match the selection pivot and a possible result of the partition operation.
Match the items from left and right columns
7
27
18
3
{ 12, 3, 7, 18, 2, 27, 44, 55 }
{ 2, 3, 7, 12, 18, 44, 55, 27 }
{ 2, 3, 12, 7, 55, 27, 18, 44 }
{ 3, 2, 7, 12, 55, 27, 18, 44 }
___

Create a free account to access the full topic