May 2018
Intermediate to advanced
328 pages
8h 15m
English
We saw a sequential implementation of the quicksort algorithm earlier. Quicksort is a divide and conquer algorithm that relies on partitioning the range to be sorted into two parts, one that contains only elements smaller than a selected element, called the pivot, and one that contains only elements greater than the pivot. It then proceeds to recursively apply the same algorithm on the two partitions, until the partitions have only one element or none. Because of the nature of the algorithm, quicksort can be easily parallelized to recursively apply the algorithm on the two partitions concurrently.
The pquicksort() function uses asynchronous functions for this purpose. However, parallelization is only efficient ...
Read now
Unlock full access