Contents / Previous / Next


Quick Sort (Applet, local backup)

Quick Sort is an in-place sort algorithm that uses the divide and conquer paradigm.

It picks an element from the array (the pivot), partitions the remaining elements into those greater than and less than this pivot, and recursively sorts the partitions.


Complexity

Quick sort has a complexity of O(n log(n) ).


Divide and Conquer

Divide and Conquer is an algorithmic technique.

To solve a problem on an instance of size n, a solution is found either directly because solving that instance is easy (typically, because the instance is small) or the instance is divided into two or more smaller instances. Each of these smaller instances is recursively solved, and the solutions are combined to produce a solution for the original instance.

Note: The name divide and conquer is because the problem is conquered by dividing it into several smaller problems.

This technique often very simple and efficient algorithms. Well-known examples include heapify, merge sort, quicksort, fast matrix multiplication and the Fast Fourier Transform (FFT).