Visualization of Quick sort

udiprod · 585K views · 2009 · 2:57

Open on YouTube

Algorithms & data structuresEducation & learningexplainer

Why Stack Overflow recommends it

Stack Overflow users link it when someone is implementing or reasoning about sorting algorithms and needs to see how the elements move.

Recommended by 3 people across 3 different months, 2011 to 2014.

What it is

A short 2009 animation by udiprod that visualizes how Bubble sort and Quick sort rearrange a sequence of colored items. It compares the number of comparisons each algorithm makes, with no narration in this version and a note pointing to an HD narrated re-release.

Cited in 1 Wikipedia article, including Sorting.

What people said

Recommends xXhRQ8sD2L7Z · 2011-01 · Stack Overflow · on “Quicksort to sort an array of objects by a particular member C++”

If you adamant on implementing your your own quicksort, I suggest watching this video to help you better visualize the algorithm. Though you've never written a quicksort you may find it easier to implement after watching it. [this video]

Recommends smac89 · 2013-09 · Stack Overflow · on “minimum switch to sorted permutation”

This totally depends on the algorithm you use. The better, the less unnecessary switches to be done. Observe: video [this video]

Recommends Charles Hetterich · 2014-11 · Stack Overflow · on “A recursive function to sort a list of ints”

For this you would want to use merge sort. Essentially in a merge sort you recursively split the list in half until you have single elements and than build it back up in the correct order. merge sort on has a complexity of O(n log(n)) and is an extremely stable sorting method. Here are some good in depth explanations and visuals for merge sorting: [this video] [LINK]