Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BinaryTreeNode

Hierarchy

  • BinaryTreeNode

Constructors

constructor

  • Parameters

    • Optional value: any

    Returns BinaryTreeNode

Properties

left

left: null | BinaryTreeNode
property

Left child

meta

meta: HashTable
property

Any meta-data about the node

nodeComparator

nodeComparator: Comparator
property

A comparator to compare nodes with each other

parent

parent: null | BinaryTreeNode
property

Parent node

right

right: null | BinaryTreeNode
property

Right child

value

value: any
property

Value of the Node

Accessors

balanceFactor

  • get balanceFactor(): number
  • Returns number

height

  • get height(): number
  • Returns number

leftHeight

  • get leftHeight(): number
  • Returns number

rightHeight

  • get rightHeight(): number
  • Returns number

uncle

  • Get parent's sibling if it exists.

    Returns undefined | BinaryTreeNode

Methods

removeChild

  • Parameters

    Returns boolean

replaceChild

  • Parameters

    Returns boolean

setLeft

setRight

setValue

  • Parameters

    • value: any

    Returns BinaryTreeNode

toString

  • toString(): string
  • Returns string

traverseInOrder

  • traverseInOrder(): any[]
  • Returns any[]

Static copyNode