2024-01-14 03:04:07 +08:00
|
|
|
export type BSTVariant = 'STANDARD' | 'INVERSE';
|
|
|
|
export type CP = 'LT' | 'EQ' | 'GT';
|
2023-11-17 22:37:35 +08:00
|
|
|
|
2023-12-11 20:27:05 +08:00
|
|
|
/**
|
|
|
|
* Enum representing different loop types.
|
|
|
|
*
|
|
|
|
* - `iterative`: Indicates the iterative loop type (with loops that use iterations).
|
|
|
|
* - `recursive`: Indicates the recursive loop type (with loops that call themselves).
|
|
|
|
*/
|
2024-01-14 03:04:07 +08:00
|
|
|
export type IterationType = 'ITERATIVE' | 'RECURSIVE';
|
2023-12-11 20:27:05 +08:00
|
|
|
|
2024-01-14 03:04:07 +08:00
|
|
|
export type FamilyPosition = 'ROOT' | 'LEFT' | 'RIGHT' | 'ROOT_LEFT' | 'ROOT_RIGHT' | 'ISOLATED' | 'MAL_NODE';
|
2023-12-11 20:27:05 +08:00
|
|
|
|
|
|
|
export type Comparator<K> = (a: K, b: K) => number;
|
|
|
|
|
|
|
|
export type DFSOrderPattern = 'pre' | 'in' | 'post';
|
|
|
|
|
|
|
|
export type NodeDisplayLayout = [string[], number, number, number];
|
|
|
|
|
|
|
|
export type BTNCallback<N, D = any> = (node: N) => D;
|
|
|
|
|
2023-11-17 22:37:35 +08:00
|
|
|
export interface IterableWithSize<T> extends Iterable<T> {
|
2023-11-19 09:04:48 +08:00
|
|
|
size: number | ((...args: any[]) => number);
|
2023-11-17 22:37:35 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface IterableWithLength<T> extends Iterable<T> {
|
2023-11-19 09:04:48 +08:00
|
|
|
length: number | ((...args: any[]) => number);
|
2023-11-17 22:37:35 +08:00
|
|
|
}
|
|
|
|
|
2023-12-21 10:26:45 +08:00
|
|
|
export type IterableWithSizeOrLength<T> = IterableWithSize<T> | IterableWithLength<T>;
|
2023-11-21 17:30:57 +08:00
|
|
|
|
2023-12-21 10:26:45 +08:00
|
|
|
export type BinaryTreePrintOptions = { isShowUndefined?: boolean; isShowNull?: boolean; isShowRedBlackNIL?: boolean };
|
2023-11-23 21:43:45 +08:00
|
|
|
|
2023-12-11 14:14:46 +08:00
|
|
|
export type BTNEntry<K, V> = [K | null | undefined, V | undefined];
|
2023-11-24 09:58:10 +08:00
|
|
|
|
2023-12-11 14:14:46 +08:00
|
|
|
export type BTNKeyOrNode<K, N> = K | null | undefined | N;
|
2023-11-24 09:58:10 +08:00
|
|
|
|
2023-12-23 11:53:18 +08:00
|
|
|
export type KeyOrNodeOrEntry<K, V, N> = BTNEntry<K, V> | BTNKeyOrNode<K, N>;
|
2023-11-25 14:38:32 +08:00
|
|
|
|
2023-12-04 21:58:41 +08:00
|
|
|
export type BTNodePureKeyOrNode<K, N> = K | N;
|
2023-11-25 14:38:32 +08:00
|
|
|
|
2023-12-11 20:27:05 +08:00
|
|
|
export type BTNodePureExemplar<K, V, N> = [K, V | undefined] | BTNodePureKeyOrNode<K, N>;
|
|
|
|
|
|
|
|
export type BSTNKeyOrNode<K, N> = K | undefined | N;
|
|
|
|
|
|
|
|
export type BinaryTreeDeleteResult<N> = { deleted: N | null | undefined; needBalanced: N | null | undefined };
|
2024-01-12 11:07:33 +08:00
|
|
|
|
2024-01-14 03:04:07 +08:00
|
|
|
export type CRUD = 'CREATED' | 'READ' | 'UPDATED' | 'DELETED';
|