-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDeque.java
More file actions
29 lines (19 loc) · 776 Bytes
/
Deque.java
File metadata and controls
29 lines (19 loc) · 776 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
/*
Write your own local Deque interface.
Include all methods your trio plans to implement.
Comment out all methods.
*/
public interface Deque<E>{
/*inserts an element at the front the deque*/
public void addFirst(E x);
/*inserts an element at the end of the deque*/
public void addLast(E x);
/*returns and removes the first element of the deque - returns null if deque is empty*/
public E pollFirst();
/*returns and removes the last element of the deque - returns null if deque is empty*/
public E pollLast();
/*returns the first element of the deque - returns null if deque is empty*/
public E peekFirst();
/*returns the last element of the deque - returns null if deque is empty*/
public E peekLast();
}