Data Structures19 sections · 729 units
Open in Course

Lessons from Last Stone

Repeated max access

What did you learn?

1.1. When you repeatedly need the maximum (or minimum), use a heap.

2.2. Simulation problems often need heaps when the order of operations depends on current state.

3.3. Max-heap vs min-heap: choose based on whether you need the largest or smallest. This was simple. You'll handle a more interesting pattern: finding the k-th largest element.