Sorting algorithms are hard to memorize.
So here's a template for tracking the important differences.
| Algo. Name | Big-O (worst case) | Suitable for large sets? | Good for partially/mostly sorted data? | Totally random data? | Notes |
|---|---|---|---|---|---|
| Bubble | O(n^2) | π | π | π | Simple/not-ideal for large data sets |
Complete the table above. ProTip: Write it by hand, so you remember AND have a cheat sheet for those tech interviews.