Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BinaryHeap<T>

Binary heap implementation

author

http://eloquentjavascript.net/appendix2.htm

param

the heap scoring function

Type parameters

  • T

Hierarchy

  • BinaryHeap

Index

Constructors

constructor

  • new BinaryHeap(scoreFunction: (x: T) => number): BinaryHeap

Properties

content

content: T[] = []

scoreFunction

scoreFunction: (x: T) => number

Type declaration

    • (x: T): number
    • Parameters

      • x: T

      Returns number

Methods

bubbleUp

  • bubbleUp(n: number): void

peek

  • peek(): T

pop

  • pop(): T

push

  • push(element: T): void

remove

  • remove(element: T): void

sinkDown

  • sinkDown(n: number): void

size

  • size(): number

Generated using TypeDoc