2023-10-27 09:17:27 +00:00
|
|
|
import {BinaryTreeNodeKey} from './data-structures';
|
2023-10-26 12:26:06 +00:00
|
|
|
|
2023-10-20 03:43:26 +00:00
|
|
|
export type Comparator<T> = (a: T, b: T) => number;
|
|
|
|
|
|
|
|
export type DFSOrderPattern = 'pre' | 'in' | 'post';
|
2023-10-25 01:57:04 +00:00
|
|
|
|
2023-10-25 13:09:11 +00:00
|
|
|
export type MapCallback<N, D = any> = (node: N) => D;
|
2023-10-25 01:57:04 +00:00
|
|
|
|
2023-10-26 12:26:06 +00:00
|
|
|
export type DefaultMapCallback<N, D = BinaryTreeNodeKey> = (node: N) => D;
|
|
|
|
|
2023-10-25 01:57:04 +00:00
|
|
|
export type MapCallbackReturn<N> = ReturnType<MapCallback<N>>;
|
|
|
|
|
2023-10-25 03:19:03 +00:00
|
|
|
export enum CP {
|
|
|
|
lt = 'lt',
|
|
|
|
eq = 'eq',
|
|
|
|
gt = 'gt'
|
|
|
|
}
|