[prev] 8 [next]

Insertion with Heaps

Insertion is a two-step process
  • add new element at next available position on bottom row
    (but this might violate heap property; new value larger than parent)
  • reorganise values along path to root to restore heap

[Diagram:Pics/heaps/heap-fixup.png]