Mark As Completed Discussion

Quick Sort Implementation

The recursive version of quick sort is very easy to implement, and is shown in the right box. See how elegant and easy it is?

Most people looking at the code can meaningfully understand the "concept" behind quick sort. It first adjusts items around the pivot, and then calls quickSort recursively on both left and right subarrays.

JAVASCRIPT
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment