2023-12-04 13:58:41 +00:00
|
|
|
export type Comparator<K> = (a: K, b: K) => number;
|
2023-11-23 13:43:45 +00:00
|
|
|
|
2023-12-04 13:58:41 +00:00
|
|
|
export enum BSTVariant {
|
|
|
|
MIN = 'MIN',
|
|
|
|
MAX = 'MAX',
|
|
|
|
}
|
2023-10-20 03:43:26 +00:00
|
|
|
|
|
|
|
export type DFSOrderPattern = 'pre' | 'in' | 'post';
|
2023-10-25 01:57:04 +00:00
|
|
|
|
2023-10-30 03:14:41 +00:00
|
|
|
export type BTNCallback<N, D = any> = (node: N) => D;
|
2023-10-25 01:57:04 +00:00
|
|
|
|
2023-10-25 03:19:03 +00:00
|
|
|
export enum CP {
|
|
|
|
lt = 'lt',
|
|
|
|
eq = 'eq',
|
|
|
|
gt = 'gt'
|
|
|
|
}
|
2023-11-17 14:37:35 +00:00
|
|
|
|
|
|
|
export interface IterableWithSize<T> extends Iterable<T> {
|
2023-11-19 01:04:48 +00:00
|
|
|
size: number | ((...args: any[]) => number);
|
2023-11-17 14:37:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IterableWithLength<T> extends Iterable<T> {
|
2023-11-19 01:04:48 +00:00
|
|
|
length: number | ((...args: any[]) => number);
|
2023-11-17 14:37:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export type IterableWithSizeOrLength<T> = IterableWithSize<T> | IterableWithLength<T>
|
2023-11-21 09:30:57 +00:00
|
|
|
|
2023-11-23 13:43:45 +00:00
|
|
|
export type BinaryTreePrintOptions = { isShowUndefined?: boolean, isShowNull?: boolean, isShowRedBlackNIL?: boolean }
|
|
|
|
|
2023-12-04 13:58:41 +00:00
|
|
|
export type BTNodeEntry<K, V> = [K | null | undefined, V | undefined];
|
2023-11-24 01:58:10 +00:00
|
|
|
|
2023-12-04 13:58:41 +00:00
|
|
|
export type BTNodeKeyOrNode<K, N> = K | null | undefined | N;
|
2023-11-24 01:58:10 +00:00
|
|
|
|
2023-12-04 13:58:41 +00:00
|
|
|
export type BTNodeExemplar<K, V, N> = BTNodeEntry<K, V> | BTNodeKeyOrNode<K, N>
|
2023-11-25 06:38:32 +00:00
|
|
|
|
2023-12-04 13:58:41 +00:00
|
|
|
export type BTNodePureExemplar<K, V, N> = [K, V | undefined] | BTNodePureKeyOrNode<K, N>
|
2023-11-25 06:38:32 +00:00
|
|
|
|
2023-12-04 13:58:41 +00:00
|
|
|
export type BTNodePureKeyOrNode<K, N> = K | N;
|
2023-11-25 06:38:32 +00:00
|
|
|
|
2023-12-04 13:58:41 +00:00
|
|
|
export type BSTNodeKeyOrNode<K, N> = K | undefined | N;
|