Refactor: Abandon the use of Comparable types as keys for the binary tree, as the '>', '>=', '<', '<=' operators are supported by the any type. The heap also adopts the same comparator as the binary tree.

This commit is contained in:
Revone 2024-01-29 11:35:24 +08:00
parent c2f98f851b
commit 3028a78985
14 changed files with 94 additions and 123 deletions

View file

@ -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<K, V, NODE> = AVLTreeMultiMapNodeNested<K, V>
> extends AVLTreeNode<K, V, NODE> {
@ -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<K, V>,
NODE extends AVLTreeMultiMapNode<K, V, NODE> = AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNodeNested<K, V>>,

View file

@ -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<K, V, NODE> = AVLTreeNodeNested<K, V>
> extends BSTNode<K, V, NODE> {
@ -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<K, V>,
NODE extends AVLTreeNode<K, V, NODE> = AVLTreeNode<K, V, AVLTreeNodeNested<K, V>>,

View file

@ -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<K, V, NODE> = BinaryTreeNode<K, V, BinaryTreeNodeNested<K, V>>
> {
@ -131,7 +130,7 @@ export class BinaryTreeNode<
*/
export class BinaryTree<
K extends Comparable,
K = any,
V = any,
R = BTNEntry<K, V>,
NODE extends BinaryTreeNode<K, V, NODE> = BinaryTreeNode<K, V, BinaryTreeNodeNested<K, V>>,
@ -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]);

View file

@ -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<K, V, NODE> = BSTNodeNested<K, V>
> extends BinaryTreeNode<K, V, NODE> {
export class BSTNode<K = any, V = any, NODE extends BSTNode<K, V, NODE> = BSTNodeNested<K, V>> 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<K, V>,
NODE extends BSTNode<K, V, NODE> = BSTNode<K, V, BSTNodeNested<K, V>>,
@ -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<K> = this._DEFAULT_COMPARATOR;
/**

View file

@ -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<K, V, NODE> = RedBlackTreeNodeNested<K, V>
> extends BSTNode<K, V, NODE> {
@ -54,7 +53,7 @@ export class RedBlackTreeNode<
}
export class RedBlackTree<
K extends Comparable,
K = any,
V = any,
R = BTNEntry<K, V>,
NODE extends RedBlackTreeNode<K, V, NODE> = RedBlackTreeNode<K, V, RedBlackTreeNodeNested<K, V>>,

View file

@ -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<K, V, NODE> = TreeMultiMapNodeNested<K, V>
> extends RedBlackTreeNode<K, V, NODE> {
@ -64,7 +63,7 @@ export class TreeMultiMapNode<
}
export class TreeMultiMap<
K extends Comparable,
K = any,
V = any,
R = BTNEntry<K, V>,
NODE extends TreeMultiMapNode<K, V, NODE> = TreeMultiMapNode<K, V, TreeMultiMapNodeNested<K, V>>,

View file

@ -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<E = any> extends IterableElementBase<E> {
/**
* 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<E> = [], options?: HeapOptions<E>) {
@ -46,27 +49,11 @@ export class Heap<E = any> extends IterableElementBase<E> {
}
}
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<E = any> extends IterableElementBase<E> {
return new Heap<E>(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<E = any> extends IterableElementBase<E> {
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<E = any> extends IterableElementBase<E> {
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<E = any> extends IterableElementBase<E> {
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<E = any> extends IterableElementBase<E> {
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<E = any> extends IterableElementBase<E> {
}
/**
* Time Complexity: O(n)
* Space Complexity: O(n)
* Time Complexity: O(1)
* Space Complexity: O(1)
*/
/**
@ -187,11 +169,6 @@ export class Heap<E = any> extends IterableElementBase<E> {
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<E = any> extends IterableElementBase<E> {
}
/**
* 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<E = any> extends IterableElementBase<E> {
/**
* 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<E = any> extends IterableElementBase<E> {
/**
* Time Complexity: O(n)
* Space Complexity: O(n)
* Space Complexity: O(1)
*/
/**
@ -296,8 +266,9 @@ export class Heap<E = any> extends IterableElementBase<E> {
}
/**
* 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<E = any> extends IterableElementBase<E> {
}
/**
* 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<E = any> extends IterableElementBase<E> {
}
/**
* Time Complexity: O(n log n)
* Time Complexity: O(n)
* Space Complexity: O(n)
*/
@ -386,7 +358,7 @@ export class Heap<E = any> extends IterableElementBase<E> {
}
/**
* Time Complexity: O(n)
* Time Complexity: O(n log n)
* Space Complexity: O(n)
*/
@ -420,6 +392,28 @@ export class Heap<E = any> extends IterableElementBase<E> {
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<E> = 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<E> {
* 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<E> {
* 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<E> {
/**
* 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<E> {
* 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<E> {
* 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 {

View file

@ -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<K, V, NODE> = BinaryTreeNodeNested<K, V>,

View file

@ -1,9 +1,8 @@
import { AVLTreeMultiMap, AVLTreeMultiMapNode } from '../../../data-structures';
import type { AVLTreeOptions } from './avl-tree';
import { Comparable } from "../../utils";
export type AVLTreeMultiMapNodeNested<K extends Comparable, V> = AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type AVLTreeMultiMapNodeNested<K, V> = AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, AVLTreeMultiMapNode<K, V, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type AVLTreeMultiMapNested<K extends Comparable, V, R, NODE extends AVLTreeMultiMapNode<K, V, NODE>> = AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type AVLTreeMultiMapNested<K, V, R, NODE extends AVLTreeMultiMapNode<K, V, NODE>> = AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, AVLTreeMultiMap<K, V, R, NODE, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type AVLTreeMultiMapOptions<K, V, R> = AVLTreeOptions<K, V, R> & {}

View file

@ -1,9 +1,8 @@
import { AVLTree, AVLTreeNode } from '../../../data-structures';
import { BSTOptions } from './bst';
import { Comparable } from "../../utils";
export type AVLTreeNodeNested<K extends Comparable, V> = AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type AVLTreeNodeNested<K, V> = AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type AVLTreeNested<K extends Comparable, V, R, NODE extends AVLTreeNode<K, V, NODE>> = AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type AVLTreeNested<K, V, R, NODE extends AVLTreeNode<K, V, NODE>> = AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, AVLTree<K, V, R, NODE, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type AVLTreeOptions<K, V, R> = BSTOptions<K, V, R> & {};

View file

@ -1,10 +1,9 @@
import { BinaryTree, BinaryTreeNode } from '../../../data-structures';
import { BTNEntry, IterationType } from '../../common';
import { Comparable } from '../../utils';
export type BinaryTreeNodeNested<K extends Comparable, V> = BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type BinaryTreeNodeNested<K, V> = BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type BinaryTreeNested<K extends Comparable, V, R, NODE extends BinaryTreeNode<K, V, NODE>> = BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type BinaryTreeNested<K, V, R, NODE extends BinaryTreeNode<K, V, NODE>> = BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, BinaryTree<K, V, R, NODE, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type BinaryTreeOptions<K, V, R> = {
iterationType?: IterationType

View file

@ -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<K extends Comparable, V> = BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type BSTNodeNested<K, V> = BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type BSTNested<K extends Comparable, V, R, NODE extends BSTNode<K, V, NODE>> = BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type BSTNested<K, V, R, NODE extends BSTNode<K, V, NODE>> = BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, BST<K, V, R, NODE, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type BSTOptions<K, V, R> = BinaryTreeOptions<K, V, R> & {
comparator?: Comparator<K>

View file

@ -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<K extends Comparable, V> = RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type RedBlackTreeNodeNested<K, V> = RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type RedBlackTreeNested<K extends Comparable, V, R, NODE extends RedBlackTreeNode<K, V, NODE>> = RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type RedBlackTreeNested<K, V, R, NODE extends RedBlackTreeNode<K, V, NODE>> = RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, RedBlackTree<K, V, R, NODE, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type RBTreeOptions<K, V, R> = BSTOptions<K, V, R> & {};

View file

@ -1,9 +1,8 @@
import { TreeMultiMap, TreeMultiMapNode } from '../../../data-structures';
import type { RBTreeOptions } from './rb-tree';
import { Comparable } from '../../utils';
export type TreeMultiMapNodeNested<K extends Comparable, V> = TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type TreeMultiMapNodeNested<K, V> = TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type TreeMultiMapNested<K extends Comparable, V, R, NODE extends TreeMultiMapNode<K, V, NODE>> = TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type TreeMultiMapNested<K, V, R, NODE extends TreeMultiMapNode<K, V, NODE>> = TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, TreeMultiMap<K, V, R, NODE, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
export type TreeMultiMapOptions<K, V, R> = RBTreeOptions<K, V, R> & {}