0

I'm confused about the final image after a delete-max operation. When 87 is deleted does 48 get brought to the spot that 87 once held? Does the rest of the tree not change after?

Min-max heap original

1 Answers1

1

No. 78 would be bubbled up to fill the spot that 87 once held.

You should read the original paper: Min-Max Heaps and Generalized Priority Queues: http://www.cs.otago.ac.nz/staffpriv/mike/Papers/MinMaxHeaps/MinMaxHeaps.pdf

Jim Mischel
  • 131,090
  • 20
  • 188
  • 351