Interface for a high-performance queue with FIFO (First-In, First-Out)
behavior.
This interface defines a mutable queue data structure where elements are
added to the back and removed from the front, maintaining the order in which
they were added. The implementation uses a circular buffer for optimal
performance, providing O(1) operations for both enqueue and dequeue
operations.
FIFO Behavior:
enqueue: Adds elements to the back of the queue
dequeue: Removes and returns elements from the front of the queue
Elements are processed in the exact order they were added
Performance Characteristics:
Enqueue: O(1) amortized (O(n) when buffer needs resizing)
Dequeue: O(1) always
Size/isEmpty: O(1) always
Memory efficient with automatic garbage collection of removed elements
Interface for a high-performance queue with FIFO (First-In, First-Out) behavior.
This interface defines a mutable queue data structure where elements are added to the back and removed from the front, maintaining the order in which they were added. The implementation uses a circular buffer for optimal performance, providing O(1) operations for both enqueue and dequeue operations.
FIFO Behavior:
Performance Characteristics:
Use Cases: