Quick sort

programming

This is a recursive algorithm used to solve the sorting problem that uses pivots $p$ to sort the list. A very brief guide to how this works is as follow

  1. Choose a pivot $p$.
  2. Partition $A$ into $A_{p}$ .
  3. Recursively sort $A_{p}$.

The issue is how to choose a good piviot $p$ - ideally you would want to pick the median element.

Run time

This runs in $O(n\log(n))$ time.