Well obviously. Were you suggesting using 4 stacks, each of size x/4
to enqueue x elements? Can you please share the algo for that?

On Jun 28, 7:54 pm, Ashish Goel <ashg...@gmail.com> wrote:
> sanket, if 2 stacks r of length x, then2x  elements should be nqed
> Best Regards
> Ashish Goel
> "Think positive and find fuel in failure"
> +919985813081
> +919966006652
>
> On Wed, Jun 29, 2011 at 4:14 AM, Sanket <vasa.san...@gmail.com> wrote:
> > @Ashish - If we have 2 stacks of length 'x' each, won't we be able to
> > enqueue 'x' elements?
>
> > On Jun 27, 10:39 pm, Ashish Goel <ashg...@gmail.com> wrote:
> > > Hi,
>
> > > The implementation is simple using 2 stacks, however we also need to make
> > > sure that if queue length is say x, we are able to enqueue x elements. As
> > > per my understanding, i could think of the solution using 4 stacks
> > instead
> > > of 2(1 for enqueue, 1 for dequeue, 1 aux for enqueue, 1 aux for dequeue)
> > .
> > > Is there any better approach.
>
> > > Best Regards
> > > Ashish Goel
> > > "Think positive and find fuel in failure"
> > > +919985813081
> > > +919966006652
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > 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.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
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