Articles on data structures and algorithms
The AlgoPath blog has 37 articles on data structures, algorithms and coding interview prep, written for developers without a CS degree. Many take one pattern at a time, with code and a worked example. The rest cover how to study and how to interview.
Binary search tree in Python: the rule, O(h) operations and two interview problems
Left smaller, right larger, for every node. The operation table, Python code, Validate BST with bounds, k-th smallest, lowest common ancestor in a BST and the mistakes.
2026-11-04
The frequency map pattern
A frequency map stores each value with the number of times it appears. One pass builds it, and four common problems fall out.
2026-11-03
Memoization in Python: lru_cache, when it helps and how it differs from a table
A dictionary in front of a recursive function turns 2ⁿ into n. When it works, Python code with lru_cache and by hand, Unique Paths, Word Break, bottom-up comparison and the mistakes.
2026-11-01
Inorder, preorder, postorder and level order: which traversal for which problem
The four orders on one tree, the table that says which to pick, recursive and iterative Python code, height and diameter, Right Side View and the mistakes.
2026-10-30
Merge intervals: sort by start, one pass, and the four problems around it
Sort by start, then extend the last interval or open a new one. Trigger words, Python code for Merge and Insert Interval, Meeting Rooms II, Non-overlapping Intervals and the mistakes.
2026-10-28
How does a hash table work
A hash table turns a key into an array index, and that one step explains every rule you were told to follow. Constant time is an average.
2026-10-27
Search in a rotated sorted array: why one half is always sorted
How binary search survives a rotation. The one comparison that finds the sorted half, Python code for the target and the minimum, a traced run, duplicates and the mistakes.
2026-10-25
BFS vs DFS: how to choose, Python code for graphs and grids, Number of Islands
One question decides it: do you need the shortest path? The choice table, trigger words, Python code for adjacency lists and grids, Number of Islands and the mistakes.
2026-10-23
Dynamic programming explained: state, transition, base and three worked problems
How to spot a DP problem, the three sentences to say before coding, bottom-up vs top-down, Python code for Climbing Stairs, Coin Change and House Robber, and the mistakes.
2026-10-21
All articles
- Binary search tree in Python: the rule, O(h) operations and two interview problems
- The frequency map pattern
- Memoization in Python: lru_cache, when it helps and how it differs from a table
- Inorder, preorder, postorder and level order: which traversal for which problem
- Merge intervals: sort by start, one pass, and the four problems around it
- How does a hash table work
- Search in a rotated sorted array: why one half is always sorted
- BFS vs DFS: how to choose, Python code for graphs and grids, Number of Islands
- Dynamic programming explained: state, transition, base and three worked problems
- Set vs map vs array: which one to use
- Backtracking algorithm: the three-line template, Python code and N Queens
- Prefix sum array: range sums in O(1) and counting subarrays with a hash map
- Sliding window algorithm: the template, Python code and how to spot it in a problem
- Time complexity from the constraints
- Dijkstra's algorithm in Python: shortest paths with a heap in O((V + E) log V)
- Priority queue in Python: heapq, the size-k trick and when a problem needs one
- Binary search on the answer: the pattern behind minimum speed and smallest capacity
- Big O notation explained simply
- Monotonic stack in Python: next greater element in O(n) and the loop to memorise
- Merge sort vs quicksort: which one to write in an interview and why
- Fast and slow pointers: cycle detection and the middle of a list in O(1) space
- Why are algorithms so hard when you can already code
- Trie in Python: how a prefix tree works and when a problem needs one
- Union-Find in Python: what it is and when a problem needs it
- Kahn's algorithm in Python: topological sort, step by step
- Two pointers vs sliding window, and three more pairs people confuse
- How to talk during a coding interview
- Coding interview anxiety: practising under a timer
- Spaced repetition: why review on day 4, not tomorrow
- Active recall: why it beats rereading
- How to approach a coding problem, word by word
- Levels, and a leaderboard anyone can see
- LeetCode patterns: the skill nobody trains
- How to prepare for coding interviews properly
- 3 new languages: Welcome TypeScript, Java and C#!
- I hate algorithms, and here is what is actually going wrong
- Why I built AlgoPath