-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueue.java
More file actions
38 lines (33 loc) · 804 Bytes
/
Queue.java
File metadata and controls
38 lines (33 loc) · 804 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
/*
* file name: Stack.java
* author: Jack Dai
* last modified: 10/23/2025
* purpose of the class:
* Creates the Queue interface for the project.
*/
public interface Queue<T> {
/**
* Adds the given {@code item} to the end of this queue.
*
* @param item the item to add to the queue.
*/
public void offer(T item);
/**
* Returns the number of items in the queue.
*
* @return the number of items in the queue.
*/
public int size();
/**
* Returns the item at the front of the queue.
*
* @return the item at the front of the queue.
*/
public T peek();
/**
* Returns and removes the item at the front of the queue.
*
* @return the item at the front of the queue.
*/
public T poll();
}