Stacker left the lazy deletion

Stacker left the lazy deletion

A method in a heap a type known position left to delete a node is using lazy strategy. To delete a node, as long as it is marked as having been deleted. When performing a F i n d M i n FindMin or D e l e t e M i n DeleteMin time, the root node is deleted if there is marked a potential problem, because the node must be deleted and the need to find the actual minimum actual element, which may involve a number of other markers have been deleted nodes.

In this method, D e l e t e Delete takes a unit, but a D e l e t e M i n DeleteMin or F i n d M i n FindMin cost, but depends on the number of flagged for deletion node.

Cheriton and Tarjan [1] discussed the heap of lazy deletion type left in the paper. The general idea is: If the root is marked for deletion, then form a stack of first traversal, and delete nodes marked for deletion, leaving a heap of collection. By all stacked in the queue, each dequeue two stacks are merged and the result at the end of the queue until the queue operation is stopped only when a stack.

Published 32 original articles · won praise 18 · views 3235

Guess you like

Origin blog.csdn.net/u011714517/article/details/104154064