Class representing a Double Ended Queue (Deque). Allows insertion and removal of elements from both ends of the queue.
The type of elements that the deque will store.
Creates an instance of the Deque class with a specified capacity. Initializes the deque with an empty list and sets head and tail pointers.
The initial capacity of the deque.
Private
Appends an element at the end of the deque.
Returns true if successfully, otherwise (the deque is full) it will returns false.
Remove all elements of the current deque.
Returns the current number of elements in the deque.
The number of elements currently stored in the deque.
Checks if the deque is full.
True if the deque has reached its capacity, otherwise false.
Returns the element at the front of the deque without removing it.
The element at the front of the deque, or undefined if the deque is empty.
Returns the element at the end of the deque without removing it.
Removes and returns the element at the end of the deque.
The element at the end of the deque, or undefined if the deque is empty.
Removes and returns the element at the front of the deque.
Generated using TypeDoc
Class representing a Double Ended Queue (Deque). Allows insertion and removal of elements from both ends of the queue.