deleteFront method

T deleteFront()

Removes and returns the element at the front of the deque. Throws a StateError if the deque is empty.

Implementation

T deleteFront() {
  if (isEmpty) {
    throw StateError('Cannot delete from an empty Deque');
  }
  return _queue.removeFirst();
}