Java Implement Stack using two Queues





This example explains how to implement stack using 2 queues.
used LinkedList for Queue , 2 queues, queue is empty add element to it
then copy Q2 remaining elements to Q1, repeat the process..
POP method returns top element .

Comments

Popular posts from this blog