export type Comparator = (a: K, b: K) => number; export enum BSTVariant { MIN = 'MIN', MAX = 'MAX', } export type DFSOrderPattern = 'pre' | 'in' | 'post'; export type BTNCallback = (node: N) => D; export enum CP { lt = 'lt', eq = 'eq', gt = 'gt' } 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 BTNodeEntry = [K | null | undefined, V | undefined]; export type BTNodeKeyOrNode = K | null | undefined | N; export type BTNodeExemplar = BTNodeEntry | BTNodeKeyOrNode export type BTNodePureExemplar = [K, V | undefined] | BTNodePureKeyOrNode export type BTNodePureKeyOrNode = K | N; export type BSTNodeKeyOrNode = K | undefined | N;