Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MaxHeap<A>

A mutable MAX HEAP data-structure. It can also work as a min heap by inverting the gt parameter.

Type parameters

  • A

Hierarchy

  • MaxHeap

Index

Accessors

Methods

Accessors

length

  • get length(): number

peek

  • get peek(): A | undefined

Static numbers

Methods

pop

  • pop(): A | undefined

push

  • push(element: A): void

Static of

  • Creates a new MaxHeap data structure.

    Type parameters

    • A

    Parameters

    • gt: function
        • (a: A, b: A): boolean
        • Parameters

          • a: A
          • b: A

          Returns boolean

    Returns MaxHeap<A>

Generated using TypeDoc