What is the height of a Heap ?

The height of a node in a heap is the number of edges on the longest simple downward path from the node to a leaf, and the height of the heap to be the height of the root, that is Θ(lgn).

Consider the following heap:

  • The height of node number 2 is 2
  • The height of the heap is 3

 

Algorithm 12 Heap 12

FOLLOW US ON LinkedIn



Explore Tutu'rself