Skip to content

Typed API (TypeDoc)


Typed API (TypeDoc) / IDequeue

Interface: IDequeue<E>

Defined in: queue.ts:45

Extends

Type Parameters

E

E

Properties

comparator

comparator: Comparator<E>

Defined in: index.ts:142

Comparator used for equality/sort checks.

Inherited from

IQueue.comparator


size

size: number

Defined in: index.ts:146

Current element count.

Inherited from

IQueue.size

Methods

add()

add(element): void

Defined in: index.ts:153

Append an element.

Parameters

element

E

Returns

void

Remarks

Complexity: Amortized O(1) unless stated otherwise.

Inherited from

IQueue.add


addAll()

addAll(collection): void

Defined in: index.ts:160

Append every element from another collection.

Parameters

collection

ICollection<E>

Returns

void

Remarks

Complexity: O(n + m) where m is collection.size.

Inherited from

IQueue.addAll


clear()

clear(): void

Defined in: index.ts:178

Remove all entries.

Returns

void

Remarks

Complexity: O(n)

Inherited from

IQueue.clear


contains()

contains(element): boolean

Defined in: index.ts:192

Test membership using the comparator when available.

Parameters

element

E

Returns

boolean

Remarks

Complexity: O(n) worst case

Inherited from

IQueue.contains


dequeue()

dequeue(): E

Defined in: queue.ts:31

Remove and return the head element.

Returns

E

Dequeued value.

Throws

When empty.

Remarks

Complexity: O(1) amortized

Inherited from

IQueue.dequeue


enqueue()

enqueue(e): void

Defined in: queue.ts:22

Append an element to the tail.

Parameters

e

E

Value to enqueue.

Returns

void

Remarks

Complexity: O(1) amortized

Inherited from

IQueue.enqueue


head(): E

Defined in: queue.ts:39

Peek the head without removal.

Returns

E

Head value.

Throws

When empty.

Inherited from

IQueue.head


isEmpty()

isEmpty(): boolean

Defined in: index.ts:185

Check for emptiness.

Returns

boolean

true when size === 0.

Inherited from

IQueue.isEmpty


pop()

pop(): E

Defined in: stack.ts:29

Pop and return the top value.

Returns

E

Removed value.

Throws

When empty.

Remarks

Complexity: O(1)

Inherited from

IStack.pop


push()

push(e): void

Defined in: stack.ts:20

Push a value on top.

Parameters

e

E

Value to push.

Returns

void

Remarks

Complexity: O(1)

Inherited from

IStack.push


remove()

remove(e, isIndex?): number | E

Defined in: index.ts:171

Remove by value or index.

Parameters

e

Element or index.

number | E

isIndex?

boolean

When true, treat e as index.

Returns

number | E

Removed element or index of removal.

Throws

If neither argument nor existing comparator are set.

Remarks

Complexity: O(n) worst case.

Inherited from

IQueue.remove


reverseIterator()

reverseIterator(): Generator<E>

Defined in: index.ts:129

Iterates elements from the most recently added to the earliest.

Returns

Generator<E>

Inherited from

IQueue.reverseIterator


sort()

sort(cmp?): void

Defined in: sort/index.ts:18

Sort the structure using the provided comparator.

Parameters

cmp?

Comparator<E>

Optional comparator; falls back to the internal one.

Returns

void

Inherited from

IQueue.sort


top()

top(): E

Defined in: stack.ts:37

Peek the top value without removing it.

Returns

E

Top value.

Throws

When empty.

Inherited from

IStack.top

Built with VitePress – Released under the MIT License.