This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: then you switch the two nodes and continue the process. Otherwise the condition is met that the node is less than its parent node, and so you can stop the process. Similarly, pop(x) and eject(x) are also virtually identical with respect to the side of the deque they effect. To pop() or eject() an item from the deque you compare its value with its two children. If the node is less than both of its children, it remains in place; otherwise, if it is greater than one or both of its children, then you switch it with the child of lowest value, thereby ensuring that of the three nodes being compared, the new parent node is lowest. For constant amortized time, apply this construct using the fibonacci heap data structure and for constant worst case time, apply this construct using splay trees....
View Full Document
This note was uploaded on 01/19/2011 for the course BA 250 taught by Professor None during the Spring '10 term at Grantham.
- Spring '10
- Personal Finance