← 📦 Data Structures15 / 25
Lesson 15 — Heap / priority
Always the smallest
heapq keeps the smallest item ready in O(log n).
Task
Push values and pop the two smallest.
Keep going with Data Structures
Ready for more? These paid resources pick up where this lesson leaves off.
UdemyBestsellers
Top-rated Data Structures courses
Project-based Data Structures video courses — the perfect paid next step after these free lessons.
Browse on Udemy →AmazonReader picks
Best Data Structures books
Hand-picked Data Structures books to master the fundamentals offline.
See on Amazon →Some links on this page are affiliate links: we may earn a commission at no extra cost to you. We only recommend tools we believe are genuinely useful.