#algorithms
5 articles
Sorting Algorithms, From Scratch
Build real sorting intuition — from the O(n²) trio to the O(n log n) workhorses: bubble, selection, insertion, merge, and quicksort.
Searching: Linear vs Binary
Binary search vs linear search explained from first principles — why halving a sorted list gives you O(log n), when it crushes linear search, and why hash tables beat both.
Shortest Paths (Dijkstra, Bellman-Ford, BFS)
Pick the right shortest-path algorithm: BFS for unweighted graphs, Dijkstra for non-negative weights, Bellman-Ford for negative edges — with every gotcha.
Greedy Algorithms
Greedy algorithms commit to the locally optimal choice and never backtrack. Learn when that beats DP cold and when it quietly hands you the wrong answer.
Divide & Conquer
Split, solve, combine: divide and conquer through merge sort, quickselect, and counting inversions — plus the master theorem and when an O(n) loop wins.