data-structure-typed/src/interfaces/binary-tree.ts

11 lines
489 B
TypeScript
Raw Normal View History

2023-09-22 02:43:16 +00:00
import {BinaryTreeNode} from '../data-structures';
import {BinaryTreeDeletedResult, BinaryTreeNodeNested, BTNCallback, BTNKey} from '../types';
export interface IBinaryTree<V = any, N extends BinaryTreeNode<V, N> = BinaryTreeNodeNested<V>> {
createNode(key: BTNKey, value?: N['value']): N;
add(keyOrNode: BTNKey | N | null, value?: N['value']): N | null | undefined;
2023-10-30 03:14:41 +00:00
delete<C extends BTNCallback<N>>(identifier: ReturnType<C> | null, callback: C): BinaryTreeDeletedResult<N>[];
}