Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DBstNode<T>

Type parameters

Hierarchy

Index

Constructors

constructor

  • new DBstNode(value?: number): DBstNode

Properties

Optional left_node

left_node: T

Optional parent_node

parent_node: T

Optional right_node

right_node: T

value

value: number

Accessors

absolute_value

  • get absolute_value(): number

equal_parent

  • get equal_parent(): T

inorder_predecessor

  • get inorder_predecessor(): T

inorder_successor

  • get inorder_successor(): T

largest_child

  • get largest_child(): T

largest_larger_child

  • get largest_larger_child(): T

root

  • get root(): T

smallest_child

  • get smallest_child(): T

smallest_smaller_child

  • get smallest_smaller_child(): T

Methods

addChild

  • addChild(node: T, parentUpdate?: (np: T) => void): void
  • Parameters

    • node: T
    • Optional parentUpdate: (np: T) => void
        • (np: T): void
        • Parameters

          • np: T

          Returns void

    Returns void

addSpaceBefore

  • addSpaceBefore(s: number, parentUpdate: (np: T) => void): void
  • Parameters

    • s: number
    • parentUpdate: (np: T) => void
        • (np: T): void
        • Parameters

          • np: T

          Returns void

    Returns void

operateOnAll

  • operateOnAll(cb: (data: T) => void): void
  • Parameters

    • cb: (data: T) => void
        • (data: T): void
        • Parameters

          • data: T

          Returns void

    Returns void

Abstract preferential_cmp

removeChild

  • removeChild(value: number, filter?: (data: T) => boolean, vals?: T[], parentUpdate?: (np: T) => void): T[]
  • Parameters

    • value: number
    • Default value filter: (data: T) => boolean = (): boolean => true
        • (data: T): boolean
        • Parameters

          • data: T

          Returns boolean

    • Default value vals: T[] = []
    • Default value parentUpdate: (np: T) => void = (): void => undefined
        • (np: T): void
        • Parameters

          • np: T

          Returns void

    Returns T[]

replaceWith

  • replaceWith(data: T, parentUpdate?: (np: T) => void): T
  • Parameters

    • data: T
    • Default value parentUpdate: (np: T) => void = (): void => undefined
        • (np: T): void
        • Parameters

          • np: T

          Returns void

    Returns T

search

selfTest

  • selfTest(parent?: T, is_left?: boolean, mnv?: number, mxv?: number, known?: DBstNode<T>[]): void
  • Parameters

    • Optional parent: T
    • Optional is_left: boolean
    • Optional mnv: number
    • Optional mxv: number
    • Default value known: DBstNode<T>[] = []

    Returns void

Generated using TypeDoc