January 2018
Intermediate to advanced
332 pages
7h 36m
English
Quicksort divides the set into two smaller subsets of low and high values based on a preselected pivot value, and these smaller subsets are then recursively sorted.
The selection of the pivot values can be done in several ways, and it is the most important aspect of the algorithm. One way is to simply pick the first, last, or the median values from the set. Then, there are custom partition schemes, such as Lomuto or Hoare (which we will use later in this chapter), which can be used to achieve the same. We will explore a couple of these implementations in this section.
Let's take a look at the pseudo code for this implementation.
Read now
Unlock full access