Options
All
  • Public
  • Public/Protected
  • All
Menu

This implementation uses a singly-linked list with a static nested class for linked-list nodes. The enqueue,

dequeue, peek, size, and is-empty operations all take constant time in the worst case.

For additional documentation, see Section 1.3 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

Type parameters

  • E

Hierarchy

Implements

Index

Properties

Private first

first: Node<E> = undefined

Private last

last: Node<E> = undefined

Private n

n: number = 0

Methods

asCollection

dequeue

  • dequeue(): E

enqueue

  • enqueue(e: E): Queue<E>

every

  • every(p: function): boolean

filter

find

  • find(p: function): E | undefined

forEach

  • forEach(f: function): void

isEmpty

  • isEmpty(): boolean

iterator

map

peek

  • peek(): E

reduce

  • reduce<A>(r: function, initialValue: A): A

size

  • size(): number

some

  • some(p: function): boolean

toString

  • toString(): string

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc