Package dsa.iface
Interface IQueue<T>
- All Known Implementing Classes:
LinkedQueue
public interface IQueue<T>
ADT to represent a Queue. A Queue is a First-In, First-Out (FIFO) data structure.
-
Method Summary
Modifier and TypeMethodDescriptiondequeue()
Remove and return the first element in the queue.void
Addelement
to the back of the queue.front()
Get (but don't remove) the element at the front of the queue.boolean
isEmpty()
Check if the queue is empty.int
size()
Get the number of elements in the queue.
-
Method Details
-
enqueue
Addelement
to the back of the queue.- Parameters:
element
-
-
dequeue
T dequeue()Remove and return the first element in the queue.- Returns:
-
size
int size()Get the number of elements in the queue.- Returns:
-
isEmpty
boolean isEmpty()Check if the queue is empty.- Returns:
true
if the queue contains no elements,false
otherwise.
-
front
T front()Get (but don't remove) the element at the front of the queue.- Returns:
-