export enum BSTVariant { STANDARD = 'STANDARD', INVERSE = 'INVERSE' } export enum CP { lt = 'lt', eq = 'eq', gt = 'gt' } /** * Enum representing different loop types. * * - `iterative`: Indicates the iterative loop type (with loops that use iterations). * - `recursive`: Indicates the recursive loop type (with loops that call themselves). */ export enum IterationType { ITERATIVE = 'ITERATIVE', RECURSIVE = 'RECURSIVE' } export enum FamilyPosition { ROOT = 'ROOT', LEFT = 'LEFT', RIGHT = 'RIGHT', ROOT_LEFT = 'ROOT_LEFT', ROOT_RIGHT = 'ROOT_RIGHT', ISOLATED = 'ISOLATED', MAL_NODE = 'MAL_NODE' } export type Comparator = (a: K, b: K) => number; export type DFSOrderPattern = 'pre' | 'in' | 'post'; export type NodeDisplayLayout = [string[], number, number, number]; export type BTNCallback = (node: N) => D; export interface IterableWithSize extends Iterable { size: number | ((...args: any[]) => number); } export interface IterableWithLength extends Iterable { length: number | ((...args: any[]) => number); } export type IterableWithSizeOrLength = IterableWithSize | IterableWithLength; export type BinaryTreePrintOptions = { isShowUndefined?: boolean; isShowNull?: boolean; isShowRedBlackNIL?: boolean }; export type BTNEntry = [K | null | undefined, V | undefined]; export type BTNKeyOrNode = K | null | undefined | N; export type BTNExemplar = BTNEntry | BTNKeyOrNode; export type BTNodePureKeyOrNode = K | N; export type BTNodePureExemplar = [K, V | undefined] | BTNodePureKeyOrNode; export type BSTNKeyOrNode = K | undefined | N; export type BinaryTreeDeleteResult = { deleted: N | null | undefined; needBalanced: N | null | undefined };