Options
All
  • Public
  • Public/Protected
  • All
Menu

Binary Heap class

export

Type parameters

  • T

Hierarchy

  • BinaryHeap

Index

Constructors

Accessors

Methods

Constructors

constructor

Accessors

list

size

  • get size(): number

Methods

add

  • add(element: T): void

decreaseKey

  • decreaseKey(index: number, newValue: Nullable<T>): void

deleteAtIndex

  • deleteAtIndex(index: number): void

extract

  • Extract least priority element.
    Remove the first element from the list.
    Replace it with the last element from the list.
    Fix the order by using sinkDown method for the first element.


    Runtime: O(log(n)).

    memberof

    BinaryHeap

    Returns Nullable<T>

findMin

Legend

  • Class
  • Class with type parameter
  • Method
  • Function
  • Type alias with type parameter
  • Enumeration
  • Interface

Generated using TypeDoc