Start Learning
Javaneer
Back to roadmap
🔍
Stage 6

Heaps, Sorting & Searching

Binary search, sorting, and the top-k toolkit.

Binary search is the most under-used interview weapon - and it works on more than sorted arrays. Combine it with a solid grasp of sorting and the heap-based top-k patterns, and a whole category of problems opens up.

5 Lessons in this stage1 h 14 min
Start the first lesson

Lessons in this stage

  1. 01

    Binary Search, Really Understood

    Advanced

    The template that avoids off-by-one bugs, why the midpoint is written (lo + hi) >>> 1, and how to find boundaries, not just exact matches.

    16 min
  2. 02

    Binary Search on the Answer

    Advanced

    The advanced trick: when a problem asks to minimize a maximum (or vice versa) and feasibility is monotonic, binary-search the answer itself.

    15 min
  3. 03

    Sorting Essentials

    Intermediate

    Merge sort and quicksort at a glance, why Java uses each, stability, and the times when sorting first is the whole solution.

    15 min
  4. 04

    Heaps & Top-K

    Advanced

    A heap of size k finds the k largest, k closest, or k most frequent in O(n log k) - without sorting everything.

    15 min
  5. 05

    Quickselect & Partitioning

    Advanced

    Find the k-th smallest element in O(n) average time using quicksort's partition step - without fully sorting.

    13 min