if only two stack are used but how pop_front is get?

suppose if element comes in order

12 15 4 3 7 20
then in min queue
1. 12                                  (12)
2. 12 12                             (12,15)
3. 12 12 4                         (12,15,4)
4.12 12 4 3                        (12,15,4,3)
5.12 12 4 3 3                     (12,15,4,3,7)
6.12 12 4 3 3 3                (12,15,4,3,20)

we can get min in constant by pop of stack but how pop front will work using
two stack only in constant time?

-- 
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