Jump to content

Weak heap: Difference between revisions

From Wikipedia, the free encyclopedia
Content deletedContent added
mAndy Dingley moved pageWeak HeaptoWeak heap:MOSTITLE
Line 14: Line 14:
==References==
==References==
{{Reflist}}
{{Reflist}}

[[Category:Heaps (data structures)]]

Revision as of 18:28, 30 November 2015

Aweak heapis a sub-form of aheapdata structure. It is a relaxed heap satisfying the following three conditions:

  1. every key in the right subtree of a node is greater than the key stored in the node itself,
  2. the root has no left child
  3. leaves are only found on the last two levels of the tree.[1]

It's form supports finding the minimum value in it with O(1) worst-case time.

It is also useful for insert and delete-min or delete and decrease, with a worst-case time of O(ln(n)).

References

  1. ^Stefan Edelkamp, "weak-heap", in Dictionary of Algorithms and Data Structures [online], Vreda Pieterse and Paul E. Black, eds. 26 May 2011. (accessed TODAY) Available from:http://www.nist.gov/dads/HTML/weakheap.html