Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BinaryHeap<T>

Binary heap implementation

class
author

http://eloquentjavascript.net/appendix2.htm

param

the heap scoring function

Type parameters

  • T

Hierarchy

  • BinaryHeap

Index

Constructors

constructor

  • new BinaryHeap(scoreFunction: function): BinaryHeap

Properties

content

content: T[] = []

scoreFunction

scoreFunction: function

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