Queue

fun Queue(initialCapacity: Int = 8, scaleFactor: Float = 1.5f, maxSize: Int = Int.MAX_VALUE)

Constructs a new Queue instance.

Parameters

initialCapacity

Initial capacity for the queue.

Default: 8

scaleFactor

Factor by which the queue's capacity will be increased at a time when required to contain appended values.

When a value is appended to the queue that would increase the queue's size to be greater than the queue's capacity, the data container underlying this queue will be resized to increase the capacity at a rate of capacity * scaleFactor.

Default: 1.5

maxSize

Size cap for the stack. If an attempt is made to append a number of items into this queue that is greater than the maxSize value, an exception will be thrown.

Default: 2147483647