import { IterationType, OptValue } from '../../common'; import { DFSOperation } from '../../../common'; export type ToEntryFn = (rawElement: R) => BTNEntry; export type BinaryTreeOptions = { iterationType?: IterationType; toEntryFn?: ToEntryFn; isMapMode?: boolean; isDuplicate?: boolean; } export type BinaryTreePrintOptions = { isShowUndefined?: boolean; isShowNull?: boolean; isShowRedBlackNIL?: boolean }; export type OptNodeOrNull = NODE | null | undefined; export type BTNOptKeyOrNull = K | null | undefined; export type BTNEntry = [BTNOptKeyOrNull, OptValue]; export type BTNOptKeyNodeOrNull = BTNOptKeyOrNull | NODE; export type BTNRep = BTNEntry | BTNOptKeyNodeOrNull; export type BinaryTreeDeleteResult = { deleted: OptNodeOrNull; needBalanced: OptNodeOrNull }; export type NodeCallback = (node: NODE) => D; export type NodePredicate = (node: NODE) => boolean; export type DFSStackItem = { opt: DFSOperation; node: OptNodeOrNull }