user5476593
user5476593

Reputation:

Min-Max heap delete max element

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

Upvotes: 0

Views: 904

Answers (1)

Jim Mischel
Jim Mischel

Reputation: 134125

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

Upvotes: 1

Related Questions