Skip to content

Instantly share code, notes, and snippets.

@bragboy
Created August 8, 2015 20:13
Show Gist options
  • Save bragboy/b59e9b2fc9953161c21e to your computer and use it in GitHub Desktop.
Save bragboy/b59e9b2fc9953161c21e to your computer and use it in GitHub Desktop.
package dsa.stack;
public class TestQueue {
public static void main(String[] args) {
QueueStack<Integer> queueUsingStack = new QueueStack<Integer>();
queueUsingStack.enQueue(1).enQueue(2).enQueue(3).enQueue(4).enQueue(5).enQueue(6);
System.out.println("Queue current size is : "+queueUsingStack.size());
System.out.println(queueUsingStack.deQueue());
System.out.println(queueUsingStack.deQueue());
System.out.println(queueUsingStack.deQueue());
System.out.println(queueUsingStack.deQueue());
queueUsingStack.enQueue(10).enQueue(11).enQueue(12);
System.out.println(queueUsingStack.deQueue());
System.out.println(queueUsingStack.deQueue());
System.out.println(queueUsingStack.deQueue());
System.out.println(queueUsingStack.deQueue());
}
}
/*
Queue current size is : 6
1
2
3
4
5
6
10
11
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment