mirror of
https://github.com/zrwusa/data-structure-typed.git
synced 2024-11-14 09:24:05 +00:00
a29dc270e6
Use a generic isComparable method to determine if a value is comparable in size when using the isKey method in the BinaryTree. Fix the boundary value bug in the getNodes method of BinaryTree. Support callback functions in getLeftMost and getRightMost to support returning results with different properties. If a comparator is specified for BST, the isKey method will force the object type to be comparable. The isComparable method has been implemented based on JavaScript's comparison principles.
11 lines
305 B
TypeScript
11 lines
305 B
TypeScript
export const isDebugTest: boolean = false;
|
|
export const isCompetitor: boolean = false;
|
|
export const isTestStackOverflow = false;
|
|
export const SYSTEM_MAX_CALL_STACK = (function getMaxStackDepth(depth = 0) {
|
|
try {
|
|
return getMaxStackDepth(depth + 1);
|
|
} catch (e) {
|
|
return depth + 3000;
|
|
}
|
|
})();
|