Options
All
  • Public
  • Public/Protected
  • All
Menu

A node in an AvlTree.

Type parameters

  • T

Hierarchy

  • AvlNode

Index

Constructors

constructor

Properties

height

height: number

The height of the node in the tree.

key

key: T

The node's identifier, used both to store a value and to compare it with others.

left

left: AvlNode<T> | null

The left child of the node.

parent

parent: AvlNode<T> | null

The parent of the node.

right

right: AvlNode<T> | null

The right child of the node.

Methods

leftHeight

  • leftHeight(): number
  • Convenience function to get the height of the left child of the node, returning -1 if the node is null.

    Returns number

    The height of the left child, or -1 if it doesn't exist.

linkLeft

  • linkLeft(node: AvlNode<T> | null): void

linkRight

  • linkRight(node: AvlNode<T> | null): void

rightHeight

  • rightHeight(): number
  • Convenience function to get the height of the right child of the node, returning -1 if the node is null.

    Returns number

    The height of the right child, or -1 if it doesn't exist.

rotateLeft

rotateRight

Generated using TypeDoc, the 1/31/2021 at 6:18:55 AM