Code is here <http://codebin.org/view/30e9f2c0>. Logic is made clear by the
variable names. Idea is similar to the one which is used to build a queue
using 2 stacks.


On Wed, May 22, 2013 at 8:45 AM, MAC <macatad...@gmail.com> wrote:

> I think this is only possible if you make sure that at push you store the
> middle element with the top element as well .. this would mean push would
> cease to be o(1)   & become o(n) .. . or is there some other trick ?
>



Veni Vedi Slumber !

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to algogeeks+unsubscr...@googlegroups.com.


Reply via email to