MODULE 13 · ADVANCED

BST, Min/Max Heaps & Priority QueuesJava & Data Structures · Module 13

Master ordered tree structures and priority queues: BST invariant search/insert/delete, array-backed binary heaps (sift-up, sift-down), and Top-K streaming algorithms.

4 lessons16 min readingTrees, Heaps, Graph Algorithms & Dynamic Programming
Free, self-paced, and open to everyone. No account needed.
WHAT THIS MODULE COVERS

BST, Min/Max Heaps & Priority Queues

Master ordered tree structures and priority queues: BST invariant search/insert/delete, array-backed binary heaps (sift-up, sift-down), and Top-K streaming algorithms.

BEFORE YOU START

Binary tree structures and comparison semantics

WHAT YOU’LL BE ABLE TO DO

Mastery of Binary Search Tree invariants, AVL rotations, Red-Black color rules, and Dual-Heap streaming median finding.

THE LESSON SEQUENCE

Read in order, or jump to what you need.

Every lesson builds on the one before it. Open any lesson to read the explanation, run the examples, and try the practice challenges.

  1. 13.01
    Binary Search Tree Operations: Validation, Search, Insert & Deletion

    Deconstruct Binary Search Trees (BST). Enforce the BST invariant, perform logarithmic search and insertion, and handle 3-case node deletion with In-Order Successors.

    4 min
  2. 13.02
    Binary Heaps & Priority Queues: Sift-Up, Sift-Down & Top-K Streams

    Master heap data structures. Understand the Complete Binary Tree property, array-backed heap indexing, sift-up/sift-down mechanics, and solve Top-K Frequent Elements.

    4 min
  3. 13.03
    Self-Balancing Trees: AVL Rotations and Red-Black Rebalancing Invariants

    Analyze the mathematics of self-balancing binary search trees: AVL height-balance factors, single and double rotations, and Red-Black coloring invariants.

    4 min
  4. 13.04
    Dual-Heap Architectures: Continuous Median Finding and Top-K Streaming

    Architect high-performance streaming analytics using dual-heap balancing for continuous median calculation and bounded PriorityQueues for Top-K tracking.

    4 min
MODULE SELF-CHECK

Ready to move on?

Implement continuous median streaming and Top-K frequency tracking using PriorityQueues.

Open the module self-check