-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueue.java
More file actions
44 lines (33 loc) · 1.01 KB
/
Copy pathQueue.java
File metadata and controls
44 lines (33 loc) · 1.01 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
35
36
37
38
39
40
41
42
43
44
/**
* This is the Queue interface for the QueueList class.
* @author Wei Zhong Tee
* @since 8 May 2020
*/
public interface Queue<E>{
/** Returns true if the stack is empty; otherwise false
@return true is stack is empty otherwise false
*/
public boolean isEmpty();
/** Returns the object at the front of the queue without removing it
@return the object at the front of the queue
@throws NoSuchElementException
*/
public E front();
/** Returns the object at the front of the queue and removes it
so stack is one smaller
@return the object at the front of the queue
@throws NoSuchElementException
*/
public E dequeue();
/** Pushes an item onto the rear of the queue
@param it The object to be inserted at the rear
*/
public void enqueue(E it);
/** Dumps the queue - clears it of its contents
*/
public void clear();
/** Returns the number of elements in the queue
@return size - the number of elements on the queue
*/
public int size();
}