I've solved it for find_min() - the find_max implementations are analogous.

Example: 
i = insert
d = delete

i 1 -
q - 1
dq - 1 <-- min value

i 2 - 
q - 1 2
dq - 1 2 (min value = 1)

d -
q - 2
dq - 2 <-- Note: min value changed

i 0 - 
q - 2 0
dq - 0 <-- Note: min value changed

Hope this makes things even clearer. :)
As for the "bonus" part. Let me know if you need an example. :)

--
DK

http://twitter.com/divyekapoor
http://www.divye.in



-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/0bsyhu-C07UJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to