mirror of
https://github.com/zrwusa/data-structure-typed.git
synced 2025-04-12 04:04:03 +00:00
27 lines
747 B
TypeScript
27 lines
747 B
TypeScript
import {AVLTreeNode} from '../data-structures';
|
|
import {IBST, IBSTNode} from './bst';
|
|
import {BinaryTreeDeletedResult, BinaryTreeNodeId} from '../types';
|
|
|
|
export type IAVLTreeNode<T, NEIGHBOR extends IAVLTreeNode<T, NEIGHBOR>> = IBSTNode<T, NEIGHBOR>
|
|
|
|
export interface IAVLTree<N extends AVLTreeNode<N['val'], N>> extends IBST<N> {
|
|
|
|
add(id: BinaryTreeNodeId, val?: N['val'] | null): N | null | undefined
|
|
|
|
remove(id: BinaryTreeNodeId, isUpdateAllLeftSum?: boolean): BinaryTreeDeletedResult<N>[]
|
|
|
|
// _balanceFactor(node: N): number
|
|
//
|
|
// _updateHeight(node: N): void
|
|
//
|
|
// _balancePath(node: N): void
|
|
//
|
|
// _balanceLL(A: N): void
|
|
//
|
|
// _balanceLR(A: N): void
|
|
//
|
|
// _balanceRR(A: N): void
|
|
//
|
|
// _balanceRL(A: N): void
|
|
}
|