ArrayListQueue

class ArrayListQueue<T> : Queue<T>

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open override val count: Int
Link copied to clipboard
open override val isEmpty: Boolean
Link copied to clipboard

Functions

Link copied to clipboard
open override fun dequeue(): T?

Removes the first element of the queue O(N) cause shifts the element for size-1 places on removal

Link copied to clipboard
open override fun enqueue(element: T): Boolean

Inserts item at the end of the queue O(1)

Link copied to clipboard
open override fun peek(): T?

Returns the first element of the queue O(1)

Link copied to clipboard
fun <T> Queue<T>.reverse()
Link copied to clipboard
open override fun toString(): String