diff --git a/src/data-structures/binary-tree/avl-tree-multi-map.ts b/src/data-structures/binary-tree/avl-tree-multi-map.ts index e90f4a1..29ae882 100644 --- a/src/data-structures/binary-tree/avl-tree-multi-map.ts +++ b/src/data-structures/binary-tree/avl-tree-multi-map.ts @@ -12,7 +12,6 @@ import type { BinaryTreeDeleteResult, BSTNKeyOrNode, BTNCallback, - Comparable, IterationType, KeyOrNodeOrEntry } from '../../types'; @@ -21,7 +20,7 @@ import { IBinaryTree } from '../../interfaces'; import { AVLTree, AVLTreeNode } from './avl-tree'; export class AVLTreeMultiMapNode< - K extends Comparable, + K = any, V = any, NODE extends AVLTreeMultiMapNode = AVLTreeMultiMapNodeNested > extends AVLTreeNode { @@ -64,7 +63,7 @@ export class AVLTreeMultiMapNode< * The only distinction between a AVLTreeMultiMap and a AVLTree lies in the ability of the former to store duplicate nodes through the utilization of counters. */ export class AVLTreeMultiMap< - K extends Comparable, + K = any, V = any, R = BTNEntry, NODE extends AVLTreeMultiMapNode = AVLTreeMultiMapNode>, diff --git a/src/data-structures/binary-tree/avl-tree.ts b/src/data-structures/binary-tree/avl-tree.ts index 8a9d812..ebcf26c 100644 --- a/src/data-structures/binary-tree/avl-tree.ts +++ b/src/data-structures/binary-tree/avl-tree.ts @@ -13,14 +13,13 @@ import type { BinaryTreeDeleteResult, BSTNKeyOrNode, BTNCallback, - Comparable, KeyOrNodeOrEntry } from '../../types'; import { BTNEntry } from '../../types'; import { IBinaryTree } from '../../interfaces'; export class AVLTreeNode< - K extends Comparable, + K = any, V = any, NODE extends AVLTreeNode = AVLTreeNodeNested > extends BSTNode { @@ -67,7 +66,7 @@ export class AVLTreeNode< * 7. Path Length: The path length from the root to any leaf is longer compared to an unbalanced BST, but shorter than a linear chain of nodes. */ export class AVLTree< - K extends Comparable, + K = any, V = any, R = BTNEntry, NODE extends AVLTreeNode = AVLTreeNode>, diff --git a/src/data-structures/binary-tree/binary-tree.ts b/src/data-structures/binary-tree/binary-tree.ts index 2185737..cd25982 100644 --- a/src/data-structures/binary-tree/binary-tree.ts +++ b/src/data-structures/binary-tree/binary-tree.ts @@ -14,7 +14,6 @@ import type { BinaryTreePrintOptions, BTNCallback, BTNEntry, - Comparable, DFSOrderPattern, EntryCallback, FamilyPosition, @@ -33,7 +32,7 @@ import { IterableEntryBase } from '../base'; * @template NODE - The type of the family relationship in the binary tree. */ export class BinaryTreeNode< - K extends Comparable, + K = any, V = any, NODE extends BinaryTreeNode = BinaryTreeNode> > { @@ -131,7 +130,7 @@ export class BinaryTreeNode< */ export class BinaryTree< - K extends Comparable, + K = any, V = any, R = BTNEntry, NODE extends BinaryTreeNode = BinaryTreeNode>, @@ -143,7 +142,7 @@ export class BinaryTree< /** * The constructor function initializes a binary tree object with optional keysOrNodesOrEntriesOrRawElements and options. - * @param [keysOrNodesOrEntriesOrRawElements] - An optional iterable of KeyOrNodeOrEntry objects. These objects represent the + * @param [keysOrNodesOrEntriesOrRawElements] - Optional iterable of KeyOrNodeOrEntry objects. These objects represent the * nodes to be added to the binary tree. * @param [options] - The `options` parameter is an optional object that can contain additional * configuration options for the binary tree. In this case, it is of type @@ -2001,7 +2000,7 @@ export class BinaryTree< // Display logic of normal nodes const key = node.key, - line = this.isNIL(node) ? 'S' : key.toString(), + line = this.isNIL(node) ? 'S' : String(key), width = line.length; return _buildNodeDisplay( @@ -2012,7 +2011,7 @@ export class BinaryTree< ); } else { // For cases where none of the conditions are met, null, undefined, and NaN nodes are not displayed - const line = node === undefined ? 'U' : 'NODE', + const line = node === undefined ? 'U' : 'N', width = line.length; return _buildNodeDisplay(line, width, [[''], 1, 0, 0], [[''], 1, 0, 0]); diff --git a/src/data-structures/binary-tree/bst.ts b/src/data-structures/binary-tree/bst.ts index 866caba..8fd1f78 100644 --- a/src/data-structures/binary-tree/bst.ts +++ b/src/data-structures/binary-tree/bst.ts @@ -12,7 +12,6 @@ import type { BSTOptions, BTNCallback, BTNPureKeyOrNodeOrEntry, - Comparable, Comparator, CP, DFSOrderPattern, @@ -24,11 +23,11 @@ import { BinaryTree, BinaryTreeNode } from './binary-tree'; import { IBinaryTree } from '../../interfaces'; import { Queue } from '../queue'; -export class BSTNode< - K extends Comparable, - V = any, - NODE extends BSTNode = BSTNodeNested -> extends BinaryTreeNode { +export class BSTNode = BSTNodeNested> extends BinaryTreeNode< + K, + V, + NODE +> { override parent?: NODE; constructor(key: K, value?: V) { @@ -94,7 +93,7 @@ export class BSTNode< * 7. No Auto-Balancing: Standard BSTs don't automatically balance themselves. */ export class BST< - K extends Comparable, + K = any, V = any, R = BTNEntry, NODE extends BSTNode = BSTNode>, @@ -799,11 +798,6 @@ export class BST< return balanced; } - /** - * Time complexity: O(n) - * Space complexity: O(n) - */ - protected _DEFAULT_COMPARATOR = (a: K, b: K): number => { if (typeof a === 'object' && typeof b === 'object' && this.comparator === this._DEFAULT_COMPARATOR) { throw TypeError( @@ -815,11 +809,6 @@ export class BST< return 0; }; - /** - * Time complexity: O(n) - * Space complexity: O(n) - */ - protected _comparator: Comparator = this._DEFAULT_COMPARATOR; /** diff --git a/src/data-structures/binary-tree/rb-tree.ts b/src/data-structures/binary-tree/rb-tree.ts index c17c84e..83d618b 100644 --- a/src/data-structures/binary-tree/rb-tree.ts +++ b/src/data-structures/binary-tree/rb-tree.ts @@ -1,7 +1,6 @@ import type { BinaryTreeDeleteResult, BTNCallback, - Comparable, CRUD, KeyOrNodeOrEntry, RBTNColor, @@ -14,7 +13,7 @@ import { BST, BSTNode } from './bst'; import { IBinaryTree } from '../../interfaces'; export class RedBlackTreeNode< - K extends Comparable, + K = any, V = any, NODE extends RedBlackTreeNode = RedBlackTreeNodeNested > extends BSTNode { @@ -54,7 +53,7 @@ export class RedBlackTreeNode< } export class RedBlackTree< - K extends Comparable, + K = any, V = any, R = BTNEntry, NODE extends RedBlackTreeNode = RedBlackTreeNode>, diff --git a/src/data-structures/binary-tree/tree-multi-map.ts b/src/data-structures/binary-tree/tree-multi-map.ts index a704865..d5fc1b2 100644 --- a/src/data-structures/binary-tree/tree-multi-map.ts +++ b/src/data-structures/binary-tree/tree-multi-map.ts @@ -9,7 +9,6 @@ import type { BinaryTreeDeleteResult, BSTNKeyOrNode, BTNCallback, - Comparable, IterationType, KeyOrNodeOrEntry, RBTNColor, @@ -22,7 +21,7 @@ import { IBinaryTree } from '../../interfaces'; import { RedBlackTree, RedBlackTreeNode } from './rb-tree'; export class TreeMultiMapNode< - K extends Comparable, + K = any, V = any, NODE extends TreeMultiMapNode = TreeMultiMapNodeNested > extends RedBlackTreeNode { @@ -64,7 +63,7 @@ export class TreeMultiMapNode< } export class TreeMultiMap< - K extends Comparable, + K = any, V = any, R = BTNEntry, NODE extends TreeMultiMapNode = TreeMultiMapNode>, diff --git a/src/data-structures/heap/heap.ts b/src/data-structures/heap/heap.ts index 665b3a0..ba9eb63 100644 --- a/src/data-structures/heap/heap.ts +++ b/src/data-structures/heap/heap.ts @@ -18,17 +18,20 @@ import { IterableElementBase } from '../base'; * 5. Managing Dynamic Data Sets: Heaps effectively manage dynamic data sets, especially when frequent access to the largest or smallest elements is required. * 6. Non-linear Search: While a heap allows rapid access to its largest or smallest element, it is less efficient for other operations, such as searching for a specific element, as it is not designed for these tasks. * 7. Efficient Sorting Algorithms: For example, heap sort. Heap sort uses the properties of a heap to sort elements. - * 8. Graph Algorithms: Such as Dijkstra's shortest path algorithm and Prim's minimum spanning tree algorithm, which use heaps to improve performance. + * 8. Graph Algorithms: Such as Dijkstra's shortest path algorithm and Prime's minimum-spanning tree algorithm, which use heaps to improve performance. */ export class Heap extends IterableElementBase { /** * The constructor initializes a heap data structure with optional elements and options. * @param elements - The `elements` parameter is an iterable object that contains the initial - * elements to be added to the heap. It is an optional parameter and if not provided, the heap will + * elements to be added to the heap. + * It is an optional parameter, and if not provided, the heap will * be initialized as empty. * @param [options] - The `options` parameter is an optional object that can contain additional - * configuration options for the heap. In this case, it is used to specify a custom comparator - * function for comparing elements in the heap. The comparator function is used to determine the + * configuration options for the heap. + * In this case, it is used to specify a custom comparator + * function for comparing elements in the heap. + * The comparator function is used to determine the * order of elements in the heap. */ constructor(elements: Iterable = [], options?: HeapOptions) { @@ -46,27 +49,11 @@ export class Heap extends IterableElementBase { } } - protected _comparator = (a: E, b: E) => { - if (!(typeof a === 'number' && typeof b === 'number')) { - throw new Error('The a, b params of compare function must be number'); - } else { - return a - b; - } - }; - - /** - * The function returns the value of the _comparator property. - * @returns The `_comparator` property is being returned. - */ - get comparator() { - return this._comparator; - } - protected _elements: E[] = []; /** * The function returns an array of elements. - * @returns The elements array is being returned. + * @returns The element array is being returned. */ get elements(): E[] { return this._elements; @@ -97,12 +84,6 @@ export class Heap extends IterableElementBase { return new Heap(elements, options); } - /** - * Time Complexity: O(log n) - * Space Complexity: O(1) - * where n is the number of elements in the heap. - */ - /** * Time Complexity: O(log n) * Space Complexity: O(1) @@ -115,17 +96,11 @@ export class Heap extends IterableElementBase { return this._bubbleUp(this.elements.length - 1); } - /** - * Time Complexity: O(log n) - * Space Complexity: O(1) - * where n is the number of elements in the heap. - */ - /** * Time Complexity: O(log n) * Space Complexity: O(1) * - * Remove and return the top element (smallest or largest element) from the heap. + * Remove and return the top element (the smallest or largest element) from the heap. * @returns The top element or undefined if the heap is empty. */ poll(): E | undefined { @@ -139,11 +114,6 @@ export class Heap extends IterableElementBase { return value; } - /** - * Time Complexity: O(1) - * Space Complexity: O(1) - */ - /** * Time Complexity: O(1) * Space Complexity: O(1) @@ -155,6 +125,12 @@ export class Heap extends IterableElementBase { return this.elements[0]; } + /** + * Time Complexity: O(log n) + * Space Complexity: O(1) + * where n is the number of elements in the heap. + */ + /** * Check if the heap is empty. * @returns True if the heap is empty, otherwise false. @@ -163,6 +139,12 @@ export class Heap extends IterableElementBase { return this.size === 0; } + /** + * Time Complexity: O(log n) + * Space Complexity: O(1) + * where n is the number of elements in the heap. + */ + /** * Reset the elements of the heap. Make the elements empty. */ @@ -171,8 +153,8 @@ export class Heap extends IterableElementBase { } /** - * Time Complexity: O(n) - * Space Complexity: O(n) + * Time Complexity: O(1) + * Space Complexity: O(1) */ /** @@ -187,11 +169,6 @@ export class Heap extends IterableElementBase { return this.fix(); } - /** - * Time Complexity: O(n) - * Space Complexity: O(1) - */ - /** * Time Complexity: O(n) * Space Complexity: O(1) @@ -205,13 +182,7 @@ export class Heap extends IterableElementBase { } /** - * Time Complexity: O(n) - * Space Complexity: O(1) - * The worst-case O(n) This is because, in the worst case, the element to be deleted is located at the end of the heap (not the root), and after deletion, we may need to reorganize the elements by performing a sinkDown operation. - */ - - /** - * Time Complexity: O(n) + * Time Complexity: O(n) * Space Complexity: O(1) * * The `delete` function removes an element from an array-like data structure, maintaining the order @@ -238,8 +209,7 @@ export class Heap extends IterableElementBase { /** * Time Complexity: O(n) - * Space Complexity: O(log n) - * where log n is the height of the heap. + * Space Complexity: O(n) */ /** @@ -281,7 +251,7 @@ export class Heap extends IterableElementBase { /** * Time Complexity: O(n) - * Space Complexity: O(n) + * Space Complexity: O(1) */ /** @@ -296,8 +266,9 @@ export class Heap extends IterableElementBase { } /** - * Time Complexity: O(n) - * Space Complexity: O(n) + * Time Complexity: O(n) + * Space Complexity: O(1) + * The worst-case O(n) This is because, in the worst case, the element to be deleted is located at the end of the heap (not the root), and after deletion, we may need to reorganize the elements by performing a sinkDown operation. */ /** @@ -314,8 +285,9 @@ export class Heap extends IterableElementBase { } /** - * Time Complexity: O(n log n) - * Space Complexity: O(n) + * Time Complexity: O(n) + * Space Complexity: O(log n) + * where log n is the height of the heap. */ /** @@ -336,7 +308,7 @@ export class Heap extends IterableElementBase { } /** - * Time Complexity: O(n log n) + * Time Complexity: O(n) * Space Complexity: O(n) */ @@ -386,7 +358,7 @@ export class Heap extends IterableElementBase { } /** - * Time Complexity: O(n) + * Time Complexity: O(n log n) * Space Complexity: O(n) */ @@ -420,6 +392,28 @@ export class Heap extends IterableElementBase { return mappedHeap; } + protected _DEFAULT_COMPARATOR = (a: E, b: E): number => { + if (typeof a === 'object' && typeof b === 'object' && this.comparator === this._DEFAULT_COMPARATOR) { + throw TypeError( + 'When comparing two object types, it is necessary to customize a [comparator] function of options parameter during the instantiation of the data structure.' + ); + } + if (a > b) return 1; + if (a < b) return -1; + return 0; + }; + + protected _comparator: Comparator = this._DEFAULT_COMPARATOR; + + + /** + * The function returns the value of the _comparator property. + * @returns The `_comparator` property is being returned. + */ + get comparator() { + return this._comparator; + } + /** * The function `_getIterator` returns an iterable iterator for the elements in the class. */ @@ -702,7 +696,7 @@ export class FibonacciHeap { * Time Complexity: O(log n) * Space Complexity: O(1) * - * Remove and return the top element (smallest or largest element) from the heap. + * Remove and return the top element (the smallest or largest element) from the heap. * @returns The top element or undefined if the heap is empty. */ poll(): E | undefined { @@ -718,7 +712,7 @@ export class FibonacciHeap { * Time Complexity: O(log n) * Space Complexity: O(1) * - * Remove and return the top element (smallest or largest element) from the heap. + * Remove and return the top element (the smallest or largest element) from the heap. * @returns The top element or undefined if the heap is empty. */ pop(): E | undefined { @@ -844,8 +838,8 @@ export class FibonacciHeap { /** * Time Complexity: O(1) * Space Complexity: O(1) - *. - * Remove and return the top element (smallest or largest element) from the heap. + * + * Remove and return the top element (the smallest or largest element) from the heap. * @param node - The node to be removed. * @protected */ @@ -864,7 +858,7 @@ export class FibonacciHeap { * Time Complexity: O(1) * Space Complexity: O(1) * - * Remove and return the top element (smallest or largest element) from the heap. + * Remove and return the top element (the smallest or largest element) from the heap. * @param y * @param x * @protected @@ -887,7 +881,7 @@ export class FibonacciHeap { * Time Complexity: O(n log n) * Space Complexity: O(n) * - * Remove and return the top element (smallest or largest element) from the heap. + * Remove and return the top element (the smallest or largest element) from the heap. * @protected */ protected _consolidate(): void { diff --git a/src/interfaces/binary-tree.ts b/src/interfaces/binary-tree.ts index d28ac6d..e545efa 100644 --- a/src/interfaces/binary-tree.ts +++ b/src/interfaces/binary-tree.ts @@ -5,12 +5,11 @@ import type { BinaryTreeNodeNested, BinaryTreeOptions, BTNCallback, - Comparable, KeyOrNodeOrEntry } from '../types'; export interface IBinaryTree< - K extends Comparable, + K = any, V = any, R = [K, V], NODE extends BinaryTreeNode = BinaryTreeNodeNested, diff --git a/src/types/data-structures/binary-tree/avl-tree-multi-map.ts b/src/types/data-structures/binary-tree/avl-tree-multi-map.ts index 78609a7..0f418b0 100644 --- a/src/types/data-structures/binary-tree/avl-tree-multi-map.ts +++ b/src/types/data-structures/binary-tree/avl-tree-multi-map.ts @@ -1,9 +1,8 @@ import { AVLTreeMultiMap, AVLTreeMultiMapNode } from '../../../data-structures'; import type { AVLTreeOptions } from './avl-tree'; -import { Comparable } from "../../utils"; -export type AVLTreeMultiMapNodeNested = AVLTreeMultiMapNode>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +export type AVLTreeMultiMapNodeNested = AVLTreeMultiMapNode>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -export type AVLTreeMultiMapNested> = AVLTreeMultiMap>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +export type AVLTreeMultiMapNested> = AVLTreeMultiMap>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> export type AVLTreeMultiMapOptions = AVLTreeOptions & {} diff --git a/src/types/data-structures/binary-tree/avl-tree.ts b/src/types/data-structures/binary-tree/avl-tree.ts index 4438480..b84b3b6 100644 --- a/src/types/data-structures/binary-tree/avl-tree.ts +++ b/src/types/data-structures/binary-tree/avl-tree.ts @@ -1,9 +1,8 @@ import { AVLTree, AVLTreeNode } from '../../../data-structures'; import { BSTOptions } from './bst'; -import { Comparable } from "../../utils"; -export type AVLTreeNodeNested = AVLTreeNode>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +export type AVLTreeNodeNested = AVLTreeNode>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -export type AVLTreeNested> = AVLTree>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +export type AVLTreeNested> = AVLTree>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> export type AVLTreeOptions = BSTOptions & {}; diff --git a/src/types/data-structures/binary-tree/binary-tree.ts b/src/types/data-structures/binary-tree/binary-tree.ts index cd52cf7..f78855d 100644 --- a/src/types/data-structures/binary-tree/binary-tree.ts +++ b/src/types/data-structures/binary-tree/binary-tree.ts @@ -1,10 +1,9 @@ import { BinaryTree, BinaryTreeNode } from '../../../data-structures'; import { BTNEntry, IterationType } from '../../common'; -import { Comparable } from '../../utils'; -export type BinaryTreeNodeNested = BinaryTreeNode>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +export type BinaryTreeNodeNested = BinaryTreeNode>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -export type BinaryTreeNested> = BinaryTree>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +export type BinaryTreeNested> = BinaryTree>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> export type BinaryTreeOptions = { iterationType?: IterationType diff --git a/src/types/data-structures/binary-tree/bst.ts b/src/types/data-structures/binary-tree/bst.ts index 416e0d6..7a54856 100644 --- a/src/types/data-structures/binary-tree/bst.ts +++ b/src/types/data-structures/binary-tree/bst.ts @@ -1,11 +1,10 @@ import { BST, BSTNode } from '../../../data-structures'; import type { BinaryTreeOptions } from './binary-tree'; import { Comparator } from '../../common'; -import { Comparable } from '../../utils'; -export type BSTNodeNested = BSTNode>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +export type BSTNodeNested = BSTNode>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -export type BSTNested> = BST>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +export type BSTNested> = BST>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> export type BSTOptions = BinaryTreeOptions & { comparator?: Comparator diff --git a/src/types/data-structures/binary-tree/rb-tree.ts b/src/types/data-structures/binary-tree/rb-tree.ts index d874ef6..3822199 100644 --- a/src/types/data-structures/binary-tree/rb-tree.ts +++ b/src/types/data-structures/binary-tree/rb-tree.ts @@ -1,11 +1,10 @@ import { RedBlackTree, RedBlackTreeNode } from '../../../data-structures'; import type { BSTOptions } from "./bst"; -import { Comparable } from "../../utils"; export type RBTNColor = 'RED' | 'BLACK'; -export type RedBlackTreeNodeNested = RedBlackTreeNode>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +export type RedBlackTreeNodeNested = RedBlackTreeNode>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -export type RedBlackTreeNested> = RedBlackTree>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +export type RedBlackTreeNested> = RedBlackTree>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> export type RBTreeOptions = BSTOptions & {}; diff --git a/src/types/data-structures/binary-tree/tree-multi-map.ts b/src/types/data-structures/binary-tree/tree-multi-map.ts index 6dbc4b6..43ccc38 100644 --- a/src/types/data-structures/binary-tree/tree-multi-map.ts +++ b/src/types/data-structures/binary-tree/tree-multi-map.ts @@ -1,9 +1,8 @@ import { TreeMultiMap, TreeMultiMapNode } from '../../../data-structures'; import type { RBTreeOptions } from './rb-tree'; -import { Comparable } from '../../utils'; -export type TreeMultiMapNodeNested = TreeMultiMapNode>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +export type TreeMultiMapNodeNested = TreeMultiMapNode>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -export type TreeMultiMapNested> = TreeMultiMap>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +export type TreeMultiMapNested> = TreeMultiMap>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> export type TreeMultiMapOptions = RBTreeOptions & {}