Skip to content

Latest commit

 

History

History
187 lines (100 loc) · 3.3 KB

linkedqueue.md

File metadata and controls

187 lines (100 loc) · 3.3 KB

dastal - v5.0.0 / LinkedQueue

Class: LinkedQueue<T>

A linked list implementation of the Queue interface

Type parameters

Name
T

Implements

Table of contents

Constructors

Accessors

Methods

Constructors

constructor

new LinkedQueue<T>(elements?)

Instantiate the queue.

Type parameters

Name
T

Parameters

Name Type Description
elements? Iterable<T> A set of elements to initialize the queue with.

Defined in

src/queue/linkedQueue.ts:11

Accessors

size

get size(): number

The number of elements in the collection.

Returns

number

Implementation of

Queue.size

Defined in

src/queue/linkedQueue.ts:37

Methods

[iterator]

[iterator](): Iterator<T, any, undefined>

Receive an iterator through the queue.

Note: Unexpected behavior can occur if the collection is modified during iteration.

Returns

Iterator<T, any, undefined>

An iterator through the queue

Implementation of

Queue.[iterator]

Defined in

src/queue/linkedQueue.ts:47


clear

clear(): void

Removes all elements.

Returns

void

Implementation of

Queue.clear

Defined in

src/queue/linkedQueue.ts:21


dequeue

dequeue(): undefined | T

Retrieves and removes the head of this queue

Returns

undefined | T

Implementation of

Queue.dequeue

Defined in

src/queue/linkedQueue.ts:25


enqueue

enqueue(element): number

Inserts the specified value into this queue

Parameters

Name Type
element T

Returns

number

Implementation of

Queue.enqueue

Defined in

src/queue/linkedQueue.ts:29


peek

peek(): undefined | T

Retrieves, but does not remove, the head of this queue

Returns

undefined | T

Implementation of

Queue.peek

Defined in

src/queue/linkedQueue.ts:33