RingBufferQueue

class RingBufferQueue<T>(size: Int) : Queue<T>

Constructors

Link copied to clipboard
constructor(size: Int)

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(1)

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

Adds element at the start 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