Min-Max堆删除最大元素

时间:2022-09-29 07:26:29

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?

删除最大操作后,我对最终图像感到困惑。当87被删除时,48会被带到87曾经持有的地方吗?树的其余部分后不会改变吗?

Min-max heap original

最小 - 最大堆原始

1 个解决方案

#1


1  

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

第78号将被鼓起来填补曾经持有的87个席位。

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

您应该阅读原始论文:Min-Max堆和广义优先级队列:http://www.cs.otago.ac.nz/staffpriv/mike/Papers/MinMaxHeaps/MinMaxHeaps.pdf

#1


1  

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

第78号将被鼓起来填补曾经持有的87个席位。

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

您应该阅读原始论文:Min-Max堆和广义优先级队列:http://www.cs.otago.ac.nz/staffpriv/mike/Papers/MinMaxHeaps/MinMaxHeaps.pdf