UNPKG

binary-type-tree

Version:
37 lines (36 loc) 1.03 kB
import { AVLNode } from "../avl-node"; import { ASNDBS, SNDBSA, INodeConstructor } from "../basic-node"; export interface IAVLTree { tree: AVLNode; insert(key: ASNDBS, value: SNDBSA): void; Delete(key: ASNDBS, value: SNDBSA): void; updateKey(key: ASNDBS, value: ASNDBS): void; } /** * Tree class for the AVL Nodes */ export declare class AVLTree extends AVLNode implements IAVLTree { options: INodeConstructor<AVLNode>; /** * The AVL Tree, accumulation of AVL Nodes. */ tree: AVLNode; /** * Constructor of the AVLTree class * @param options */ constructor(options: INodeConstructor<AVLNode>); /** * Insert a new AVL Node into the tree an maintain AVL balance. * @param key * @param value */ insert(key: ASNDBS, value: SNDBSA): void; /** * Delete a key or value and maintain AVL balance. * @param key * @param value */ Delete(key: ASNDBS, value: SNDBSA): void; updateKey(key: ASNDBS, newKey: ASNDBS): void; }