data-structure-typed 1.47.5 → 1.47.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/ISSUE_TEMPLATE/bug_report.md +10 -7
- package/.github/workflows/ci.yml +1 -1
- package/.github/workflows/release-package.yml +1 -1
- package/CHANGELOG.md +1 -1
- package/CODE_OF_CONDUCT.md +32 -10
- package/COMMANDS.md +3 -1
- package/CONTRIBUTING.md +4 -3
- package/README.md +103 -28
- package/SECURITY.md +1 -1
- package/benchmark/report.html +46 -1
- package/benchmark/report.json +563 -8
- package/dist/cjs/data-structures/binary-tree/avl-tree.d.ts +36 -18
- package/dist/cjs/data-structures/binary-tree/avl-tree.js +46 -29
- package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +158 -129
- package/dist/cjs/data-structures/binary-tree/binary-tree.js +182 -184
- package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/bst.d.ts +73 -63
- package/dist/cjs/data-structures/binary-tree/bst.js +168 -169
- package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/rb-tree.d.ts +54 -17
- package/dist/cjs/data-structures/binary-tree/rb-tree.js +77 -31
- package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/tree-multimap.d.ts +29 -40
- package/dist/cjs/data-structures/binary-tree/tree-multimap.js +66 -136
- package/dist/cjs/data-structures/binary-tree/tree-multimap.js.map +1 -1
- package/dist/cjs/data-structures/graph/abstract-graph.js +1 -1
- package/dist/cjs/data-structures/graph/abstract-graph.js.map +1 -1
- package/dist/cjs/data-structures/hash/hash-map.d.ts +2 -6
- package/dist/cjs/data-structures/hash/hash-map.js +5 -8
- package/dist/cjs/data-structures/hash/hash-map.js.map +1 -1
- package/dist/cjs/data-structures/heap/heap.d.ts +19 -21
- package/dist/cjs/data-structures/heap/heap.js +52 -34
- package/dist/cjs/data-structures/heap/heap.js.map +1 -1
- package/dist/cjs/data-structures/heap/max-heap.d.ts +2 -5
- package/dist/cjs/data-structures/heap/max-heap.js +2 -2
- package/dist/cjs/data-structures/heap/max-heap.js.map +1 -1
- package/dist/cjs/data-structures/heap/min-heap.d.ts +2 -5
- package/dist/cjs/data-structures/heap/min-heap.js +2 -2
- package/dist/cjs/data-structures/heap/min-heap.js.map +1 -1
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.d.ts +2 -1
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js +9 -1
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +1 -1
- package/dist/cjs/data-structures/linked-list/singly-linked-list.d.ts +2 -1
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js +8 -1
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -1
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.d.ts +2 -5
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.js +2 -2
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.js.map +1 -1
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.d.ts +2 -5
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.js +2 -2
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +1 -1
- package/dist/cjs/data-structures/priority-queue/priority-queue.d.ts +2 -5
- package/dist/cjs/data-structures/priority-queue/priority-queue.js +2 -2
- package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +1 -1
- package/dist/cjs/data-structures/queue/deque.d.ts +1 -0
- package/dist/cjs/data-structures/queue/deque.js +3 -0
- package/dist/cjs/data-structures/queue/deque.js.map +1 -1
- package/dist/cjs/data-structures/queue/queue.d.ts +1 -0
- package/dist/cjs/data-structures/queue/queue.js +3 -0
- package/dist/cjs/data-structures/queue/queue.js.map +1 -1
- package/dist/cjs/data-structures/stack/stack.d.ts +2 -1
- package/dist/cjs/data-structures/stack/stack.js +10 -2
- package/dist/cjs/data-structures/stack/stack.js.map +1 -1
- package/dist/cjs/data-structures/trie/trie.d.ts +3 -0
- package/dist/cjs/data-structures/trie/trie.js +19 -4
- package/dist/cjs/data-structures/trie/trie.js.map +1 -1
- package/dist/cjs/interfaces/binary-tree.d.ts +4 -2
- package/dist/cjs/types/common.d.ts +7 -0
- package/dist/cjs/types/common.js.map +1 -1
- package/dist/cjs/types/data-structures/binary-tree/binary-tree.d.ts +1 -1
- package/dist/cjs/types/data-structures/binary-tree/bst.d.ts +2 -2
- package/dist/cjs/types/data-structures/hash/hash-map.d.ts +1 -2
- package/dist/cjs/types/data-structures/heap/heap.d.ts +4 -1
- package/dist/cjs/types/data-structures/priority-queue/priority-queue.d.ts +2 -1
- package/dist/mjs/data-structures/binary-tree/avl-tree.d.ts +36 -18
- package/dist/mjs/data-structures/binary-tree/avl-tree.js +49 -30
- package/dist/mjs/data-structures/binary-tree/binary-tree.d.ts +158 -129
- package/dist/mjs/data-structures/binary-tree/binary-tree.js +182 -194
- package/dist/mjs/data-structures/binary-tree/bst.d.ts +73 -63
- package/dist/mjs/data-structures/binary-tree/bst.js +171 -170
- package/dist/mjs/data-structures/binary-tree/rb-tree.d.ts +54 -17
- package/dist/mjs/data-structures/binary-tree/rb-tree.js +81 -33
- package/dist/mjs/data-structures/binary-tree/tree-multimap.d.ts +29 -40
- package/dist/mjs/data-structures/binary-tree/tree-multimap.js +70 -138
- package/dist/mjs/data-structures/graph/abstract-graph.js +1 -1
- package/dist/mjs/data-structures/hash/hash-map.d.ts +2 -6
- package/dist/mjs/data-structures/hash/hash-map.js +5 -8
- package/dist/mjs/data-structures/heap/heap.d.ts +19 -21
- package/dist/mjs/data-structures/heap/heap.js +53 -35
- package/dist/mjs/data-structures/heap/max-heap.d.ts +2 -5
- package/dist/mjs/data-structures/heap/max-heap.js +2 -2
- package/dist/mjs/data-structures/heap/min-heap.d.ts +2 -5
- package/dist/mjs/data-structures/heap/min-heap.js +2 -2
- package/dist/mjs/data-structures/linked-list/doubly-linked-list.d.ts +2 -1
- package/dist/mjs/data-structures/linked-list/doubly-linked-list.js +9 -1
- package/dist/mjs/data-structures/linked-list/singly-linked-list.d.ts +2 -1
- package/dist/mjs/data-structures/linked-list/singly-linked-list.js +8 -1
- package/dist/mjs/data-structures/priority-queue/max-priority-queue.d.ts +2 -5
- package/dist/mjs/data-structures/priority-queue/max-priority-queue.js +2 -2
- package/dist/mjs/data-structures/priority-queue/min-priority-queue.d.ts +2 -5
- package/dist/mjs/data-structures/priority-queue/min-priority-queue.js +2 -2
- package/dist/mjs/data-structures/priority-queue/priority-queue.d.ts +2 -5
- package/dist/mjs/data-structures/priority-queue/priority-queue.js +2 -2
- package/dist/mjs/data-structures/queue/deque.d.ts +1 -0
- package/dist/mjs/data-structures/queue/deque.js +3 -0
- package/dist/mjs/data-structures/queue/queue.d.ts +1 -0
- package/dist/mjs/data-structures/queue/queue.js +3 -0
- package/dist/mjs/data-structures/stack/stack.d.ts +2 -1
- package/dist/mjs/data-structures/stack/stack.js +10 -2
- package/dist/mjs/data-structures/trie/trie.d.ts +3 -0
- package/dist/mjs/data-structures/trie/trie.js +20 -4
- package/dist/mjs/interfaces/binary-tree.d.ts +4 -2
- package/dist/mjs/types/common.d.ts +7 -0
- package/dist/mjs/types/data-structures/binary-tree/binary-tree.d.ts +1 -1
- package/dist/mjs/types/data-structures/binary-tree/bst.d.ts +2 -2
- package/dist/mjs/types/data-structures/hash/hash-map.d.ts +1 -2
- package/dist/mjs/types/data-structures/heap/heap.d.ts +4 -1
- package/dist/mjs/types/data-structures/priority-queue/priority-queue.d.ts +2 -1
- package/dist/umd/data-structure-typed.js +629 -595
- package/dist/umd/data-structure-typed.min.js +2 -2
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/package.json +1 -1
- package/src/data-structures/binary-tree/avl-tree.ts +61 -31
- package/src/data-structures/binary-tree/binary-tree.ts +283 -254
- package/src/data-structures/binary-tree/bst.ts +193 -170
- package/src/data-structures/binary-tree/rb-tree.ts +87 -32
- package/src/data-structures/binary-tree/tree-multimap.ts +76 -136
- package/src/data-structures/graph/abstract-graph.ts +1 -1
- package/src/data-structures/hash/hash-map.ts +8 -8
- package/src/data-structures/heap/heap.ts +57 -39
- package/src/data-structures/heap/max-heap.ts +5 -5
- package/src/data-structures/heap/min-heap.ts +5 -5
- package/src/data-structures/linked-list/doubly-linked-list.ts +10 -1
- package/src/data-structures/linked-list/singly-linked-list.ts +9 -1
- package/src/data-structures/priority-queue/max-priority-queue.ts +4 -3
- package/src/data-structures/priority-queue/min-priority-queue.ts +12 -12
- package/src/data-structures/priority-queue/priority-queue.ts +3 -3
- package/src/data-structures/queue/deque.ts +4 -0
- package/src/data-structures/queue/queue.ts +4 -0
- package/src/data-structures/stack/stack.ts +12 -3
- package/src/data-structures/trie/trie.ts +23 -4
- package/src/interfaces/binary-tree.ts +14 -2
- package/src/types/common.ts +15 -1
- package/src/types/data-structures/binary-tree/binary-tree.ts +1 -1
- package/src/types/data-structures/binary-tree/bst.ts +2 -3
- package/src/types/data-structures/hash/hash-map.ts +1 -2
- package/src/types/data-structures/heap/heap.ts +3 -1
- package/src/types/data-structures/priority-queue/priority-queue.ts +3 -1
- package/test/integration/{all-in-one.ts → all-in-one.test.ts} +1 -1
- package/test/integration/index.html +87 -0
- package/test/performance/data-structures/comparison/comparison.test.ts +7 -6
- package/test/performance/data-structures/heap/heap.test.ts +2 -2
- package/test/performance/data-structures/priority-queue/priority-queue.test.ts +1 -1
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +20 -20
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +56 -57
- package/test/unit/data-structures/binary-tree/bst.test.ts +49 -54
- package/test/unit/data-structures/binary-tree/overall.test.ts +17 -18
- package/test/unit/data-structures/binary-tree/rb-tree.test.ts +3 -3
- package/test/unit/data-structures/binary-tree/tree-multimap.test.ts +118 -66
- package/test/unit/data-structures/heap/heap.test.ts +2 -2
- package/test/unit/data-structures/heap/max-heap.test.ts +1 -1
- package/test/unit/data-structures/heap/min-heap.test.ts +1 -1
- package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +4 -3
- package/test/unit/data-structures/priority-queue/priority-queue.test.ts +9 -10
- package/test/unit/data-structures/stack/stack.test.ts +2 -2
- package/test/unit/unrestricted-interconversion.test.ts +156 -0
- package/tsconfig-cjs.json +1 -1
- package/test/integration/conversion.test.ts +0 -0
|
@@ -11,7 +11,12 @@ export class Stack {
|
|
|
11
11
|
* is provided and is an array, it is assigned to the `_elements
|
|
12
12
|
*/
|
|
13
13
|
constructor(elements) {
|
|
14
|
-
this._elements =
|
|
14
|
+
this._elements = [];
|
|
15
|
+
if (elements) {
|
|
16
|
+
for (const el of elements) {
|
|
17
|
+
this.push(el);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
15
20
|
}
|
|
16
21
|
_elements;
|
|
17
22
|
get elements() {
|
|
@@ -135,7 +140,7 @@ export class Stack {
|
|
|
135
140
|
* @returns An iterator object.
|
|
136
141
|
*/
|
|
137
142
|
*[Symbol.iterator]() {
|
|
138
|
-
for (let i = this.elements.length
|
|
143
|
+
for (let i = 0; i < this.elements.length; i++) {
|
|
139
144
|
yield this.elements[i];
|
|
140
145
|
}
|
|
141
146
|
}
|
|
@@ -179,4 +184,7 @@ export class Stack {
|
|
|
179
184
|
}
|
|
180
185
|
return accumulator;
|
|
181
186
|
}
|
|
187
|
+
print() {
|
|
188
|
+
console.log([...this]);
|
|
189
|
+
}
|
|
182
190
|
}
|
|
@@ -20,6 +20,8 @@ export declare class TrieNode {
|
|
|
20
20
|
*/
|
|
21
21
|
export declare class Trie {
|
|
22
22
|
constructor(words?: string[], caseSensitive?: boolean);
|
|
23
|
+
protected _size: number;
|
|
24
|
+
get size(): number;
|
|
23
25
|
protected _caseSensitive: boolean;
|
|
24
26
|
get caseSensitive(): boolean;
|
|
25
27
|
protected _root: TrieNode;
|
|
@@ -145,6 +147,7 @@ export declare class Trie {
|
|
|
145
147
|
filter(predicate: (word: string, index: number, trie: this) => boolean): string[];
|
|
146
148
|
map(callback: (word: string, index: number, trie: this) => string): Trie;
|
|
147
149
|
reduce<T>(callback: (accumulator: T, word: string, index: number, trie: this) => T, initialValue: T): T;
|
|
150
|
+
print(): void;
|
|
148
151
|
/**
|
|
149
152
|
* Time Complexity: O(M), where M is the length of the input string.
|
|
150
153
|
* Space Complexity: O(1) - Constant space.
|
|
@@ -26,12 +26,17 @@ export class Trie {
|
|
|
26
26
|
constructor(words, caseSensitive = true) {
|
|
27
27
|
this._root = new TrieNode('');
|
|
28
28
|
this._caseSensitive = caseSensitive;
|
|
29
|
+
this._size = 0;
|
|
29
30
|
if (words) {
|
|
30
|
-
for (const
|
|
31
|
-
this.add(
|
|
31
|
+
for (const word of words) {
|
|
32
|
+
this.add(word);
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
35
|
}
|
|
36
|
+
_size;
|
|
37
|
+
get size() {
|
|
38
|
+
return this._size;
|
|
39
|
+
}
|
|
35
40
|
_caseSensitive;
|
|
36
41
|
get caseSensitive() {
|
|
37
42
|
return this._caseSensitive;
|
|
@@ -55,6 +60,7 @@ export class Trie {
|
|
|
55
60
|
add(word) {
|
|
56
61
|
word = this._caseProcess(word);
|
|
57
62
|
let cur = this.root;
|
|
63
|
+
let isNewWord = false;
|
|
58
64
|
for (const c of word) {
|
|
59
65
|
let nodeC = cur.children.get(c);
|
|
60
66
|
if (!nodeC) {
|
|
@@ -63,8 +69,12 @@ export class Trie {
|
|
|
63
69
|
}
|
|
64
70
|
cur = nodeC;
|
|
65
71
|
}
|
|
66
|
-
cur.isEnd
|
|
67
|
-
|
|
72
|
+
if (!cur.isEnd) {
|
|
73
|
+
isNewWord = true;
|
|
74
|
+
cur.isEnd = true;
|
|
75
|
+
this._size++;
|
|
76
|
+
}
|
|
77
|
+
return isNewWord;
|
|
68
78
|
}
|
|
69
79
|
/**
|
|
70
80
|
* Time Complexity: O(M), where M is the length of the input word.
|
|
@@ -131,6 +141,9 @@ export class Trie {
|
|
|
131
141
|
return false;
|
|
132
142
|
};
|
|
133
143
|
dfs(this.root, 0);
|
|
144
|
+
if (isDeleted) {
|
|
145
|
+
this._size--;
|
|
146
|
+
}
|
|
134
147
|
return isDeleted;
|
|
135
148
|
}
|
|
136
149
|
/**
|
|
@@ -353,6 +366,9 @@ export class Trie {
|
|
|
353
366
|
}
|
|
354
367
|
return accumulator;
|
|
355
368
|
}
|
|
369
|
+
print() {
|
|
370
|
+
console.log([...this]);
|
|
371
|
+
}
|
|
356
372
|
/**
|
|
357
373
|
* Time Complexity: O(M), where M is the length of the input string.
|
|
358
374
|
* Space Complexity: O(1) - Constant space.
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { BinaryTree, BinaryTreeNode } from '../data-structures';
|
|
2
|
-
import { BinaryTreeNested, BinaryTreeNodeNested, BiTreeDeleteResult, BTNCallback, BTNKey } from '../types';
|
|
2
|
+
import { BinaryTreeNested, BinaryTreeNodeNested, BinaryTreeOptions, BiTreeDeleteResult, BTNCallback, BTNKey, BTNodeExemplar } from '../types';
|
|
3
3
|
export interface IBinaryTree<V = any, N extends BinaryTreeNode<V, N> = BinaryTreeNodeNested<V>, TREE extends BinaryTree<V, N, TREE> = BinaryTreeNested<V, N>> {
|
|
4
4
|
createNode(key: BTNKey, value?: N['value']): N;
|
|
5
|
-
|
|
5
|
+
createTree(options?: Partial<BinaryTreeOptions>): TREE;
|
|
6
|
+
add(keyOrNodeOrEntry: BTNodeExemplar<V, N>, count?: number): N | null | undefined;
|
|
7
|
+
addMany(nodes: Iterable<BTNodeExemplar<V, N>>): (N | null | undefined)[];
|
|
6
8
|
delete<C extends BTNCallback<N>>(identifier: ReturnType<C> | null, callback: C): BiTreeDeleteResult<N>[];
|
|
7
9
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BTNKey } from "./data-structures";
|
|
1
2
|
export type Comparator<T> = (a: T, b: T) => number;
|
|
2
3
|
export type DFSOrderPattern = 'pre' | 'in' | 'post';
|
|
3
4
|
export type BTNCallback<N, D = any> = (node: N) => D;
|
|
@@ -18,3 +19,9 @@ export type BinaryTreePrintOptions = {
|
|
|
18
19
|
isShowNull?: boolean;
|
|
19
20
|
isShowRedBlackNIL?: boolean;
|
|
20
21
|
};
|
|
22
|
+
export type BTNodeEntry<T> = [BTNKey | null | undefined, T | undefined];
|
|
23
|
+
export type BTNodeKeyOrNode<N> = BTNKey | null | undefined | N;
|
|
24
|
+
export type BTNodeExemplar<T, N> = BTNodeEntry<T> | BTNodeKeyOrNode<N>;
|
|
25
|
+
export type BTNodePureExemplar<T, N> = [BTNKey, T | undefined] | BTNodePureKeyOrNode<N>;
|
|
26
|
+
export type BTNodePureKeyOrNode<N> = BTNKey | N;
|
|
27
|
+
export type BSTNodeKeyOrNode<N> = BTNKey | undefined | N;
|
|
@@ -26,6 +26,6 @@ export type BiTreeDeleteResult<N> = {
|
|
|
26
26
|
export type BinaryTreeNodeNested<T> = BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, BinaryTreeNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
|
|
27
27
|
export type BinaryTreeNested<T, N extends BinaryTreeNode<T, N>> = BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, BinaryTree<T, N, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
|
|
28
28
|
export type BinaryTreeOptions = {
|
|
29
|
-
iterationType
|
|
29
|
+
iterationType: IterationType;
|
|
30
30
|
};
|
|
31
31
|
export type NodeDisplayLayout = [string[], number, number, number];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BST, BSTNode } from '../../../data-structures';
|
|
2
2
|
import type { BinaryTreeOptions, BTNKey } from './binary-tree';
|
|
3
|
-
|
|
3
|
+
import { Comparator } from "../../common";
|
|
4
4
|
export type BSTNodeNested<T> = BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, BSTNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
|
|
5
5
|
export type BSTNested<T, N extends BSTNode<T, N>> = BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, BST<T, N, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
|
|
6
6
|
export type BSTOptions = BinaryTreeOptions & {
|
|
7
|
-
comparator
|
|
7
|
+
comparator: Comparator<BTNKey>;
|
|
8
8
|
};
|
|
@@ -4,8 +4,7 @@ export type HashMapLinkedNode<K, V> = {
|
|
|
4
4
|
next: HashMapLinkedNode<K, V>;
|
|
5
5
|
prev: HashMapLinkedNode<K, V>;
|
|
6
6
|
};
|
|
7
|
-
export type HashMapOptions<K
|
|
8
|
-
elements: Iterable<[K, V]>;
|
|
7
|
+
export type HashMapOptions<K> = {
|
|
9
8
|
hashFn: (key: K) => string;
|
|
10
9
|
objHashFn: (key: K) => object;
|
|
11
10
|
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { HeapOptions } from "../heap";
|
|
2
|
+
export type PriorityQueueOptions<T> = HeapOptions<T> & {};
|