Show Menu
Cheatography

Sorting algorithms Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Merge sort

1.Divides the array in half
2.Sorts each of these halves
3.Merges them back together
- Each of these haves have the same sorting algorithm applied to it
- Eventually you are merging just 2 single element arrays

Quick sort

Array is split in two parts based on a pivot point (one with elements larger than the pivot, one with elements smaller than the pivot) and is recurs­ively repeated
Divide­-an­d-c­onquer, massively recursive sort
 

Radix sort

1. First look at the least sig fig and sort everybody based on this.
2. Sort based on 2nd most sig fig -> Whenever I have repetition in the 2nd digit -> the 2nd order already in the 1st one kicks in
3. Repeat for the most sig dig and maintain everybody else
Type of stable sort (order of duplicates is mainta­ined)
 

Asymptotic analysis