-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDequeADT.java
More file actions
48 lines (38 loc) · 837 Bytes
/
DequeADT.java
File metadata and controls
48 lines (38 loc) · 837 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
38
39
40
41
42
43
44
45
46
47
48
public interface DequeADT<E> {
/**
* Returns the number of elements in the deque.
*/
public int size();
/**
* Returns whether the deque is empty.
*/
public boolean isEmpty();
/**
* Inserts an element to be the first in the deque.
*/
public void addFirst (E element);
/**
* Inserts an element to be the last in the deque.
*/
public void addLast (E element);
/**
* Returns the first element
* @throws EmptyDequeException
*/
public E getFirst();
/**
* Returns the last element;
* @throws EmptyDequeException
*/
public E getLast();
/**
* Removes the first element
* @throws EmptyDequeException
*/
public E removeFirst();
/**
* Removes the last element
* @throws EmptyDequeException
*/
public E removeLast();
}