Core paths · 14 steps

Fundamentals

From precise problem statements and Big O to arrays, hashing, recursion, searching, sorting and trees: the base every later topic builds on.

Who it is for
New programmers, and developers who learned DSA informally and want a sound base without gaps.
By the end
You can state a problem precisely, estimate what a solution costs, pick a suitable built-in collection, and solve beginner problems with arrays, hashing and two pointers.
  1. Step 1: State problems precisely

    Every later step assumes you can name inputs, outputs and constraints and argue that a loop is correct; that habit is cheapest to build first.

  2. Step 2: Count what code costs

    Big O is the vocabulary for comparing every structure that follows. Counting real loops by hand makes the notation concrete.

  3. Step 3: See where data lives

    Values, references and contiguous memory explain why arrays are fast and linked structures are not, before you meet either.

  4. Step 4: Use the collections you already have

    Most real code uses library collections. Knowing their costs early avoids hidden quadratic loops like repeated front insertion.

  5. Step 5: Arrays and dynamic arrays

    The array is the structure underneath most others. Seeing a dynamic array grow explains amortized O(1) append.

  6. Step 6: Strings

    Strings are arrays with encoding rules and immutability; building them efficiently is a common source of accidental O(n²).

  7. Step 7: Linked lists

    Pointer-based storage is the contrast to arrays and the basis of stacks, queues and graphs.

  8. Step 8: Stacks and queues

    LIFO and FIFO order are the two disciplines behind parsing, undo, scheduling and graph search.

  9. Step 9: Hash tables and sets

    Expected O(1) lookup removes the inner loop from many brute-force solutions; it is the single most useful structure in practice.

  10. Step 10: Recursion

    Trees, divide and conquer, backtracking and dynamic programming are all recursive; the call stack must feel familiar first.

  11. Step 11: Linear and binary search

    Binary search is the first algorithm whose cost is logarithmic, and its invariant reasoning is reused everywhere.

  12. Step 12: Sorting

    Sorting is a building block for search, greedy algorithms and interval problems; comparing the classic sorts teaches stability and in-place trade-offs.

  13. Step 13: First pattern: two pointers

    With arrays, sorting and complexity in place, two pointers is the first technique that turns an O(n²) idea into O(n).

  14. Step 14: Trees and traversals

    Trees close the fundamentals: they combine recursion with queues and lead into search trees, heaps and graphs.