Binary Heap

Binary Heap

  • A heap is either a min-heap or a max-heap
  • min-heap supports the insert and deletemin operations while a max-heap supports the insert and deletemax operations
  • Heaps could be binary or d-ary. Binary heaps are special forms of binary trees while d-ary heaps are a special class of general trees
  • A binary heap is a complete binary tree with elements from a partially ordered set, such that the element at every node is less than (or equal to) the element at its left child and the element at its right child
Example of max binary heap
Example of min binary heap

Related Posts