Home Reference Source
public class | source

Queue

Stack: FIFO data structure Usage: let queue = new Queue(); queue.enqueue('A'); queue.enqueue('B'); queue.dequeue(); => A'

Constructor Summary

Public Constructor
public

Method Summary

Public Methods
public

clear(): void

Clears all items currently in the queue

public

Returns the current count of the items in the Queue.

public

dequeue(): <Item>

Dequeues the oldest item enqueued into the queue.

public

enqueue(item: item): Queue

Enqueues an item to the front of the Queue.

public

Returns true if the Queue contains no items, otherwise false.

Public Constructors

public constructor source

Public Methods

public clear(): void source

Clears all items currently in the queue

Return:

void

public count(): Number source

Returns the current count of the items in the Queue.

Return:

Number

public dequeue(): <Item> source

Dequeues the oldest item enqueued into the queue.

Return:

<Item>

public enqueue(item: item): Queue source

Enqueues an item to the front of the Queue.

Params:

NameTypeAttributeDescription
item item

to set on the vertex

Return:

Queue

current instance of graph.

public isEmpty(): Boolean source

Returns true if the Queue contains no items, otherwise false.

Return:

Boolean