Hello,

I need the logic to implement a stack by using two queues.

can anybody help in this ?

Thanks & regards,
Kishore

Member Avatar for iamthwee

Do you mean implement a queue using two stacks?

>I need the logic to implement a stack by using two queues.
There's no practical application for this, so we can definitely conclude that it's homework. In that case, what have you tried and what have you learned from it? We're not going to just solve the problem for you so you can get a good grade without earning it.

>Do you mean implement a queue using two stacks?
Maybe, but it could be either. I've seen both as homework assignments.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.