Options
All
  • Public
  • Public/Protected
  • All
Menu

The Node class contains the methods to add, remove and modify the arcs of the node in a constant time. Each node contains id, balance and a map of outgoing arcs.

Hierarchy

  • Node

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Node(id: number, balance: number, arcs?: Arc[]): Node

Properties

Private arcs

arcs: Map<number, Arc>

balance

balance: number

id

id: number

Methods

addArc

  • addArc(arc: Arc): void

getArc

  • getArc(head: number): Arc

getArcs

  • getArcs(): Arc[]

hasArc

  • hasArc(head: number): boolean

removeArc

  • removeArc(head: number): void

size

  • size(): number
  • Returns the number of the arcs of the node.

    Returns number

    The number of the node arcs.

Legend

  • Constructor
  • Property
  • Method
  • Private property

Generated using TypeDoc