Created
February 23, 2017 15:40
-
-
Save shreezan123/3c07976f1107cbcd8a965d952c5b8bcc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Driver; | |
import howard.edu.ood.hw2.collections.ArrayQueue; | |
public class Main_Queue { | |
public static void main(String args[]){ | |
ArrayQueue myqueue = new ArrayQueue(10); | |
//to enqueue elements onto the stack | |
for (int i = 0; i<20;i++){ | |
myqueue.enqueue(i*10); | |
} | |
//Printing elements after enqueueing | |
System.out.println("Queue after enqueueing 20 items to it"); | |
System.out.println(myqueue.toString()); | |
//to dequeue elements from the stack | |
System.out.println("Dequeueing following items: "); | |
for (int i = 0; i< 5; i++){ | |
System.out.println(myqueue.dequeue()); | |
} | |
//Printing elements after dequeueing | |
System.out.println("Queue after 5 items being dequeued"); | |
System.out.println(myqueue.toString()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment