March 2019
Intermediate to advanced
336 pages
9h 9m
English
Quick sort is an algorithm for sorting the elements of a collection in an organized way. Parallelized quick sort is two to three times faster than merge sort and heap sort. The algorithm's performance is of the order O(n log n). This algorithm is a space-optimized version of the binary tree sort algorithm.
In the following code snippet, the quick sort algorithm is implemented. The QuickSorter function takes an array of integer elements, upper int, and below int as parameters. The function divides the array into parts, which are recursively divided and sorted:
//main package has examples shown// in Go Data Structures and algorithms bookpackage main// importing fmt packageimport ( "fmt")//Quick Sorter methodfunc QuickSorter(elements []int, ...
Read now
Unlock full access