-
Notifications
You must be signed in to change notification settings - Fork 3
/
DequeDriver.java
59 lines (47 loc) · 1.47 KB
/
DequeDriver.java
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
Bayan Berri
APCS2 pd4
HW29--Stress is the Best
2017-04-05
*/
public class DequeDriver{
public static void main( String[] args){
DLLDeque<String> tester= new DLLDeque<String>();
tester.addFirst("a");
System.out.println("updated deque:");
System.out.println(tester);
tester.addFirst("b");
System.out.println("updated deque:");
System.out.println(tester);
tester.addFirst("c");
System.out.println("updated deque:");
System.out.println(tester);
tester.addLast("l1");
System.out.println("updated deque:");
System.out.println(tester);
tester.addLast("l2");
System.out.println("updated deque:");
System.out.println(tester);
tester.addLast("l3");
System.out.println("updated deque:");
System.out.println(tester);
System.out.println("testing toString() now:");
System.out.println(tester);
System.out.println("testing removeLast() now:");
System.out.println(tester.removeLast());
System.out.println("testing toString() now:");
System.out.println(tester);
System.out.println("testing removeFirst() now:");
System.out.println(tester.removeFirst());
System.out.println("updated deque:");
System.out.println(tester);
System.out.println("testing peekFirst() now:");
System.out.println(tester.peekFirst());
System.out.println("peek doesn't update the deque::");
System.out.println(tester);
System.out.println("testing peekLast() now:");
System.out.println(tester.peekLast());
/*-----------------------------------------
----------------------------------*/
}
}