container interface

Remarks

Describes the methods and properties that all containers have

Type Parameters

  • T

Hierarchy

Implements

Constructors

Properties

h_: T[]

array heap

opts_: undefined | Options<T>

Accessors

  • get reverse(): Iterable<T>
  • Sealed

    Returns an object that implements a js Iterable, but it traverses the data in reverse

    Returns Iterable<T>

Methods

  • Traverse the container looking for elements until the callback returns true, then stop looking

    Returns

    whether the element was found

    Parameters

    • callback: ValidCallback<T>

      Determine whether it is the element to be found

    • Optional reverse: boolean

      If true, traverse the container in reverse order

    Returns boolean

  • Fix re-establishes the heap ordering after the element at index i has changed its value.

    Parameters

    • i: number

    Returns void

  • get heap array element

    Throws

    TypeError

    Throws

    RangeError

    Parameters

    • i: number

    Returns T

  • return js iterator

    Parameters

    • Optional reverse: boolean

      If true, returns an iterator to traverse in reverse

    Returns Iterator<T, any, undefined>

  • Adds all the elements of an container into a string, separated by the specified separator string.

    Type Parameters

    • TO

    Parameters

    • Optional separator: string

      A string used to separate one element of the container from the next in the resulting string. If omitted, the array elements are separated with a comma.

    • Optional callback: MapCallback<T, TO>
    • Optional reverse: boolean

      If true, traverse the container in reverse order

    Returns string

  • Push pushes the element vals onto the heap.

    Parameters

    • Rest ...vals: T[]

    Returns void

  • Remove removes and returns the element at index i from the heap.

    Throws

    TypeError

    Throws

    RangeError

    Parameters

    • i: number

    Returns T

  • set heap array element

    Throws

    TypeError

    Throws

    RangeError

    Parameters

    • i: number
    • val: T

    Returns void

Generated using TypeDoc