Summary

In this chapter, we learned about the binary heap data structure and its two variants: the min heap and max heap. We learned how to insert values, how to peek or find the minimum or maximum values, and also how to extract a value from the heap. We also covered the sift up and sift down operations that help to maintain the organized heap.

We also learned how to use the heap data structure to create the heap sort algorithm.

In the next chapter, we will study the basic concepts of graphs, which are non-linear data structures.

Get Learning JavaScript Data Structures and Algorithms - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.