Source: qvault.io

Quick Sort in Golang
Qvault.io – Coding courses to launch your tech career True to its name, quicksort is one of the fastest sorting algorithms, that said, you need to be careful with the implementation details because if you’re not careful the speed can degrade quickly.

The quickSort() function is really just a wrapper around the partition function, and it handles the recursive nature of the algorithm.

In the best case, the pivot is the middle element of each sublist which results in log(n) calls to partition().

While the version of quicksort that we implemented is almost always able to perform at speeds of O(n*log(n)), it’s Big O complexity is still technically O(n^2).

Related Articles