Binary Heap and Heap Sort

In the previous chapter, we learned about the tree data structure. In this chapter, we will learn about a special type of binary tree, which is the heap data structure, also known as the binary heap. The binary heap is a very famous data structure in computer science, commonly applied in priority queues due to its efficiency of quickly extracting the maximum or minimum values. It is also used by the famous heap sort algorithm.

In this chapter, we will cover:

  • The binary heap data structure
  • Max and min heap
  • The heap sort algorithm

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.