Foundations
The ideas everything else is built on: how to count the cost of code, how arrays and strings behave, how recursion unwinds, and how hashing finds things in one step. Each one has a live visualizer running the real code.
- 01Counting stepsBig-O by watching the counter: a loop inside a loop costs n².O(n²)
- 02Linear searchCheck every item in turn. The baseline every faster search is measured against.O(n)
- 03Rotating an arrayShift every item k places using three reversals and no extra array.O(n)
- 04Palindrome checkCompare a string from both ends inwards, one pair of letters at a time.O(n)
- 05RecursionA function that calls itself, with every waiting call shown on the stack.O(n)
- 06Hash tableTurn each key into a bucket number so lookups skip the search entirely.O(1) avg
- 07Finding duplicatesRemember what you have seen in a hash set and the n² check becomes n.O(n)