forked from arin2002/Hacktoberfest-2022
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainClass.java
More file actions
37 lines (29 loc) · 831 Bytes
/
MainClass.java
File metadata and controls
37 lines (29 loc) · 831 Bytes
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
package deque;
import java.util.ArrayDeque;
public class MainClass {
public static void main(String[] args) {
ArrayDeque <Integer> mq = new ArrayDeque<>();
// mq.offerFirst(45);
mq.addFirst(89);
// mq.offerFirst(12);
//
// mq.pop();
// System.out.println(mq.peekFirst());
Mydeque <Integer> md = new Mydeque <> () ;
md.addLast(13);
// md.addFirst(46);
// md.addFirst(78);
// md.addLast(49);
// md.addLast(99);
// md.addFirst(8);
System.out.println(md.removeLast());
// md.addFirst(9);
// System.out.println(md.removeLast());
System.out.println(md.getFirst());
// System.out.println(md.removeFirst());
// System.out.println(md.getLast());
// System.out.println(md.removeFirst());
// System.out.println(md.getFirst());
// System.out.println(md.getLast());
}
}