data-structure-typed/src/types/common.ts

23 lines
644 B
TypeScript
Raw Normal View History

export type Comparator<T> = (a: T, b: T) => number;
export type DFSOrderPattern = 'pre' | 'in' | 'post';
2023-10-30 03:14:41 +00:00
export type BTNCallback<N, D = any> = (node: N) => D;
export enum CP {
lt = 'lt',
eq = 'eq',
gt = 'gt'
}
export interface IterableWithSize<T> extends Iterable<T> {
size: number | ((...args: any[]) => number);
}
export interface IterableWithLength<T> extends Iterable<T> {
length: number | ((...args: any[]) => number);
}
export type IterableWithSizeOrLength<T> = IterableWithSize<T> | IterableWithLength<T>
export type BinaryTreePrintOptions = {isShowUndefined?: boolean, isShowNull?: boolean, isShowRedBlackNIL?: boolean}