What are the best resources to learn about heaps in programming?

July 3, 2025 3 answers
Asked by venue capacity 210
Hey everyone! I'm gearing up to dive into heaps next week and would love to hear your recommendations. Based on your experiences, what resources have helped you understand heaps and how they're applied in programming? I specifically want to grasp the concepts well enough to intuitively know when to use them. I primarily code in JavaScript, so any tailored advice is greatly appreciated!

Answers

2pass ream
For what it's worthโ€”I've got 40 years in programming, and I can't recall using heaps much. However, if youโ€™re prepping for interviews at big companies, understanding data structures like heaps will definitely help, especially with coding practice on sites like LeetCode. I'm currently revisiting each data structure and working through related problems too!
Reply to this answer
latchkey learner
Are you focusing on the heap data structure or the heap in terms of memory allocation? Since you mentioned JavaScript, I assume you're referring to the data structure. Just wanted to clarify!
Reply to this answer
LOWER_case
Check out these two links on Wikipedia about heap data structures: 1. [Heap (data structure)](https://en.wikipedia.org/wiki/Heap_(data_structure)) 2. [Min-max heap](https://en.m.wikipedia.org/wiki/Min-max_heap) These cover the common types of heaps, and they're particularly useful for implementing priority queues. Iโ€™ve used heaps for timers beforeโ€”I keep a min-heap of timer values, and pop them off as they go off!
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions