Algorithms
Classic CS algorithms, data structures, and problem-solving patterns.
- Bubble Sort The simplest sorting algorithm — compare adjacent elements and bubble the largest to the top.
- Insertion Sort Sort by placing each element into its correct position — like organizing a hand of cards.
- Dutch National Flag Problem Dijkstra's three-pointer partitioning algorithm for sorting elements into three groups in O(n).
- Stack Sort Sorting a stack using only PUSH/POP and recursion — no loops allowed.
- Kadane's Algorithm Finding the maximum subarray sum in O(n) using dynamic programming.
- Levenshtein Distance Computing edit distance between two strings with dynamic programming — insertion, deletion, and substitution.
- Floyd's Cycle Detection The Tortoise and Hare algorithm for detecting cycles in linked lists, with a mathematical proof.
- Graph Traversal BFS and DFS implementations — the two fundamental ways to explore a graph.
- Branchless Programming Eliminating if-else branches with bitwise operations for better CPU pipeline performance.
- LeetCode Classics Solutions to Three Sum, Add Two Numbers, and Longest Substring Without Repeating Characters.