Datasets:

ArXiv:
License:
File size: 985 Bytes
c574d3a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package rd222dv_assign2.Queues;

public class QueueMain {

	public static void main(String[] args) {
		/**

		 * Testing all methods

		 */

		Queue queue = new LinkedQueue();

		queue.enqueue("cat");
		queue.enqueue("turtle");
		queue.enqueue("mouse");
		queue.enqueue("butterfly");

		System.out.println("Is Empty? " + queue.isEmpty());
		System.out.println("Current size: " + queue.size());
		System.out.println("Current queue: " + queue.toString());

		System.out.println("First: " + queue.first());
		System.out.println("Last: " + queue.last());

		System.out.println("Dequeue: " + queue.dequeue());
		System.out.println("Current size: " + queue.size());
		System.out.println("Current queue: " + queue.toString());

		queue.dequeue();
		queue.dequeue();
		System.out.println("Current size: " + queue.size());
		System.out.println("Current queue: " + queue.toString());
		queue.dequeue();
		System.out.println("Is Empty? " + queue.isEmpty());
	}
}