import { BTNKey } from "./data-structures"; export type Comparator = (a: T, b: T) => number; 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 = [BTNKey | null | undefined, T | undefined]; export type BTNodeKeyOrNode = BTNKey | null | undefined | N; export type BTNodeExemplar = BTNodeEntry | BTNodeKeyOrNode export type BTNodePureExemplar = [BTNKey, T | undefined] | BTNodePureKeyOrNode export type BTNodePureKeyOrNode = BTNKey | N; export type BSTNodeKeyOrNode = BTNKey | undefined | N;