Queue: 1 2 3 4 1 5 6 7 1. After deleting from the head, you always should 
update minimum element for O(n).

However, there is another way for queue modification, so the current min is 
accessed for O(1).
This can be done using queue and initial elements (may be in a separate 
queue).

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@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