-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDequeTester.java
More file actions
34 lines (26 loc) · 1.02 KB
/
Copy pathDequeTester.java
File metadata and controls
34 lines (26 loc) · 1.02 KB
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
public class DequeTester{
public static void main(String[] args){
//Set up is thanks to Colin Hosking and his QAF post !
QQKachoo<String> test = new QQKachoo<String>();
test.addFirst("apple");
test.addFirst("brick");
test.addFirst("sky");
test.addLast("Dequeue");
test.addLast("Deque");
test.addLast("Deke");
System.out.println(test.isEmpty());
System.out.println(test.peekFirst()); //sky
System.out.println(test.removeFirst()); //sky
System.out.println(test.peekLast()); //Deke
System.out.println(test.removeLast()); //Deke
System.out.println(test.peekFirst()); //brick
System.out.println(test.removeFirst()); //brick
System.out.println(test.peekLast()); //Deque
System.out.println(test.removeLast()); //Deque
System.out.println(test.peekFirst()); //apple
System.out.println(test.removeFirst()); //apple
System.out.println(test.peekLast()); //Dequeue
System.out.println(test.removeLast()); //Dequeue
System.out.println(test.isEmpty());
} //end main
}