2024-01-13 19:04:07 +00:00
|
|
|
export type BSTVariant = 'STANDARD' | 'INVERSE';
|
|
|
|
export type CP = 'LT' | 'EQ' | 'GT';
|
2023-11-17 14:37:35 +00:00
|
|
|
|
2023-12-11 12:27:05 +00: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-13 19:04:07 +00:00
|
|
|
export type IterationType = 'ITERATIVE' | 'RECURSIVE';
|
2023-12-11 12:27:05 +00:00
|
|
|
|
2024-01-13 19:04:07 +00:00
|
|
|
export type FamilyPosition = 'ROOT' | 'LEFT' | 'RIGHT' | 'ROOT_LEFT' | 'ROOT_RIGHT' | 'ISOLATED' | 'MAL_NODE';
|
2023-12-11 12:27:05 +00:00
|
|
|
|
|
|
|
export type Comparator<K> = (a: K, b: K) => number;
|
|
|
|
|
2024-01-14 11:49:50 +00:00
|
|
|
export type DFSOrderPattern = 'PRE' | 'IN' | 'POST';
|
2023-12-11 12:27:05 +00:00
|
|
|
|
|
|
|
export type NodeDisplayLayout = [string[], number, number, number];
|
|
|
|
|
|
|
|
export type BTNCallback<N, D = any> = (node: N) => D;
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2023-12-21 02:26:45 +00:00
|
|
|
export type IterableWithSizeOrLength<T> = IterableWithSize<T> | IterableWithLength<T>;
|
2023-11-21 09:30:57 +00:00
|
|
|
|
2023-12-21 02:26:45 +00:00
|
|
|
export type BinaryTreePrintOptions = { isShowUndefined?: boolean; isShowNull?: boolean; isShowRedBlackNIL?: boolean };
|
2023-11-23 13:43:45 +00:00
|
|
|
|
2023-12-11 06:14:46 +00:00
|
|
|
export type BTNEntry<K, V> = [K | null | undefined, V | undefined];
|
2023-11-24 01:58:10 +00:00
|
|
|
|
2023-12-11 06:14:46 +00:00
|
|
|
export type BTNKeyOrNode<K, N> = K | null | undefined | N;
|
2023-11-24 01:58:10 +00:00
|
|
|
|
2023-12-23 03:53:18 +00:00
|
|
|
export type KeyOrNodeOrEntry<K, V, N> = BTNEntry<K, V> | BTNKeyOrNode<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-11 12:27:05 +00: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 03:07:33 +00:00
|
|
|
|
2024-01-13 19:04:07 +00:00
|
|
|
export type CRUD = 'CREATED' | 'READ' | 'UPDATED' | 'DELETED';
|