ListQueue<E> constructor

ListQueue<E>([
  1. int? initialCapacity
])

Create an empty queue.

If initialCapacity is given, prepare the queue for at least that many elements.

Implementation

ListQueue([int? initialCapacity])
    : _head = 0,
      _tail = 0,
      _table = List<E?>.filled(_calculateCapacity(initialCapacity), null);