Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AvlTreeIndex<T>

LokiDB AVL Balanced Binary Tree Index implementation. To support duplicates, we use siblings (array) in tree nodes. Basic AVL components guided by William Fiset tutorials at : https://github.com/williamfiset/data-structures/blob/master/com/williamfiset/datastructures/balancedtree/AVLTreeRecursive.java https://www.youtube.com/watch?v=g4y2h70D6Nk&list=PLDV1Zeh2NRsD06x59fxczdWLhDDszUHKt

Type parameters

  • T

Hierarchy

  • AvlTreeIndex

Implements

Index

Constructors

constructor

Properties

apex

apex: number | null = null

comparator

comparator: ILokiComparer<T>

name

name: string

nodes

nodes: ITreeNodeHash<T>

Methods

backup

getValuesAsTree

  • getValuesAsTree(node?: TreeNode<T>): any

insert

  • insert(id: number, val: T): void
  • Used for inserting a new value into the BinaryTreeIndex

    Parameters

    • id: number

      Unique Id (such as $loki) to associate with value

    • val: T

      Value to be indexed and inserted into binary tree

    Returns void

insertNode

rangeRequest

remove

  • remove(id: number): void

restore

update

  • update(id: number, val: T): void
  • Updates a value, possibly relocating it, within binary tree

    Parameters

    • id: number

      Unique Id (such as $loki) to associate with value

    • val: T

      New value to be indexed within binary tree

    Returns void

validateIndex

  • validateIndex(): boolean

Generated using TypeDoc