Jump to content

Fibonacci heap: Difference between revisions

m
Line 845:
node.right.left = node.left
end
 
function delete!(root, node)
if (parent = node.parent) == nothing
Line 854:
else
remove_from_child_list(root, parent, node)
end
if root.rootlist != nothing
root.nodecount -= 1
root.minnode = root.rootlist
for n in aslist(root.rootlist)
if n != nothing && n.value < root.minnode.value
root.minnode = n
end
end
end
end
Line 884 ⟶ 893:
Delete(h3, xkeys[3])
print(h3)
println("The minimum of h3 is now: ", Minimum(h3).value
</lang>{{out}}
<pre>
Line 919 ⟶ 929:
│ └─╴time
└─╴now
The minimum of h3 is now: good
</pre>
 
4,105

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.