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.
Files changed (169) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +10 -7
  2. package/.github/workflows/ci.yml +1 -1
  3. package/.github/workflows/release-package.yml +1 -1
  4. package/CHANGELOG.md +1 -1
  5. package/CODE_OF_CONDUCT.md +32 -10
  6. package/COMMANDS.md +3 -1
  7. package/CONTRIBUTING.md +4 -3
  8. package/README.md +103 -28
  9. package/SECURITY.md +1 -1
  10. package/benchmark/report.html +46 -1
  11. package/benchmark/report.json +563 -8
  12. package/dist/cjs/data-structures/binary-tree/avl-tree.d.ts +36 -18
  13. package/dist/cjs/data-structures/binary-tree/avl-tree.js +46 -29
  14. package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -1
  15. package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +158 -129
  16. package/dist/cjs/data-structures/binary-tree/binary-tree.js +182 -184
  17. package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -1
  18. package/dist/cjs/data-structures/binary-tree/bst.d.ts +73 -63
  19. package/dist/cjs/data-structures/binary-tree/bst.js +168 -169
  20. package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -1
  21. package/dist/cjs/data-structures/binary-tree/rb-tree.d.ts +54 -17
  22. package/dist/cjs/data-structures/binary-tree/rb-tree.js +77 -31
  23. package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -1
  24. package/dist/cjs/data-structures/binary-tree/tree-multimap.d.ts +29 -40
  25. package/dist/cjs/data-structures/binary-tree/tree-multimap.js +66 -136
  26. package/dist/cjs/data-structures/binary-tree/tree-multimap.js.map +1 -1
  27. package/dist/cjs/data-structures/graph/abstract-graph.js +1 -1
  28. package/dist/cjs/data-structures/graph/abstract-graph.js.map +1 -1
  29. package/dist/cjs/data-structures/hash/hash-map.d.ts +2 -6
  30. package/dist/cjs/data-structures/hash/hash-map.js +5 -8
  31. package/dist/cjs/data-structures/hash/hash-map.js.map +1 -1
  32. package/dist/cjs/data-structures/heap/heap.d.ts +19 -21
  33. package/dist/cjs/data-structures/heap/heap.js +52 -34
  34. package/dist/cjs/data-structures/heap/heap.js.map +1 -1
  35. package/dist/cjs/data-structures/heap/max-heap.d.ts +2 -5
  36. package/dist/cjs/data-structures/heap/max-heap.js +2 -2
  37. package/dist/cjs/data-structures/heap/max-heap.js.map +1 -1
  38. package/dist/cjs/data-structures/heap/min-heap.d.ts +2 -5
  39. package/dist/cjs/data-structures/heap/min-heap.js +2 -2
  40. package/dist/cjs/data-structures/heap/min-heap.js.map +1 -1
  41. package/dist/cjs/data-structures/linked-list/doubly-linked-list.d.ts +2 -1
  42. package/dist/cjs/data-structures/linked-list/doubly-linked-list.js +9 -1
  43. package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +1 -1
  44. package/dist/cjs/data-structures/linked-list/singly-linked-list.d.ts +2 -1
  45. package/dist/cjs/data-structures/linked-list/singly-linked-list.js +8 -1
  46. package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -1
  47. package/dist/cjs/data-structures/priority-queue/max-priority-queue.d.ts +2 -5
  48. package/dist/cjs/data-structures/priority-queue/max-priority-queue.js +2 -2
  49. package/dist/cjs/data-structures/priority-queue/max-priority-queue.js.map +1 -1
  50. package/dist/cjs/data-structures/priority-queue/min-priority-queue.d.ts +2 -5
  51. package/dist/cjs/data-structures/priority-queue/min-priority-queue.js +2 -2
  52. package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +1 -1
  53. package/dist/cjs/data-structures/priority-queue/priority-queue.d.ts +2 -5
  54. package/dist/cjs/data-structures/priority-queue/priority-queue.js +2 -2
  55. package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +1 -1
  56. package/dist/cjs/data-structures/queue/deque.d.ts +1 -0
  57. package/dist/cjs/data-structures/queue/deque.js +3 -0
  58. package/dist/cjs/data-structures/queue/deque.js.map +1 -1
  59. package/dist/cjs/data-structures/queue/queue.d.ts +1 -0
  60. package/dist/cjs/data-structures/queue/queue.js +3 -0
  61. package/dist/cjs/data-structures/queue/queue.js.map +1 -1
  62. package/dist/cjs/data-structures/stack/stack.d.ts +2 -1
  63. package/dist/cjs/data-structures/stack/stack.js +10 -2
  64. package/dist/cjs/data-structures/stack/stack.js.map +1 -1
  65. package/dist/cjs/data-structures/trie/trie.d.ts +3 -0
  66. package/dist/cjs/data-structures/trie/trie.js +19 -4
  67. package/dist/cjs/data-structures/trie/trie.js.map +1 -1
  68. package/dist/cjs/interfaces/binary-tree.d.ts +4 -2
  69. package/dist/cjs/types/common.d.ts +7 -0
  70. package/dist/cjs/types/common.js.map +1 -1
  71. package/dist/cjs/types/data-structures/binary-tree/binary-tree.d.ts +1 -1
  72. package/dist/cjs/types/data-structures/binary-tree/bst.d.ts +2 -2
  73. package/dist/cjs/types/data-structures/hash/hash-map.d.ts +1 -2
  74. package/dist/cjs/types/data-structures/heap/heap.d.ts +4 -1
  75. package/dist/cjs/types/data-structures/priority-queue/priority-queue.d.ts +2 -1
  76. package/dist/mjs/data-structures/binary-tree/avl-tree.d.ts +36 -18
  77. package/dist/mjs/data-structures/binary-tree/avl-tree.js +49 -30
  78. package/dist/mjs/data-structures/binary-tree/binary-tree.d.ts +158 -129
  79. package/dist/mjs/data-structures/binary-tree/binary-tree.js +182 -194
  80. package/dist/mjs/data-structures/binary-tree/bst.d.ts +73 -63
  81. package/dist/mjs/data-structures/binary-tree/bst.js +171 -170
  82. package/dist/mjs/data-structures/binary-tree/rb-tree.d.ts +54 -17
  83. package/dist/mjs/data-structures/binary-tree/rb-tree.js +81 -33
  84. package/dist/mjs/data-structures/binary-tree/tree-multimap.d.ts +29 -40
  85. package/dist/mjs/data-structures/binary-tree/tree-multimap.js +70 -138
  86. package/dist/mjs/data-structures/graph/abstract-graph.js +1 -1
  87. package/dist/mjs/data-structures/hash/hash-map.d.ts +2 -6
  88. package/dist/mjs/data-structures/hash/hash-map.js +5 -8
  89. package/dist/mjs/data-structures/heap/heap.d.ts +19 -21
  90. package/dist/mjs/data-structures/heap/heap.js +53 -35
  91. package/dist/mjs/data-structures/heap/max-heap.d.ts +2 -5
  92. package/dist/mjs/data-structures/heap/max-heap.js +2 -2
  93. package/dist/mjs/data-structures/heap/min-heap.d.ts +2 -5
  94. package/dist/mjs/data-structures/heap/min-heap.js +2 -2
  95. package/dist/mjs/data-structures/linked-list/doubly-linked-list.d.ts +2 -1
  96. package/dist/mjs/data-structures/linked-list/doubly-linked-list.js +9 -1
  97. package/dist/mjs/data-structures/linked-list/singly-linked-list.d.ts +2 -1
  98. package/dist/mjs/data-structures/linked-list/singly-linked-list.js +8 -1
  99. package/dist/mjs/data-structures/priority-queue/max-priority-queue.d.ts +2 -5
  100. package/dist/mjs/data-structures/priority-queue/max-priority-queue.js +2 -2
  101. package/dist/mjs/data-structures/priority-queue/min-priority-queue.d.ts +2 -5
  102. package/dist/mjs/data-structures/priority-queue/min-priority-queue.js +2 -2
  103. package/dist/mjs/data-structures/priority-queue/priority-queue.d.ts +2 -5
  104. package/dist/mjs/data-structures/priority-queue/priority-queue.js +2 -2
  105. package/dist/mjs/data-structures/queue/deque.d.ts +1 -0
  106. package/dist/mjs/data-structures/queue/deque.js +3 -0
  107. package/dist/mjs/data-structures/queue/queue.d.ts +1 -0
  108. package/dist/mjs/data-structures/queue/queue.js +3 -0
  109. package/dist/mjs/data-structures/stack/stack.d.ts +2 -1
  110. package/dist/mjs/data-structures/stack/stack.js +10 -2
  111. package/dist/mjs/data-structures/trie/trie.d.ts +3 -0
  112. package/dist/mjs/data-structures/trie/trie.js +20 -4
  113. package/dist/mjs/interfaces/binary-tree.d.ts +4 -2
  114. package/dist/mjs/types/common.d.ts +7 -0
  115. package/dist/mjs/types/data-structures/binary-tree/binary-tree.d.ts +1 -1
  116. package/dist/mjs/types/data-structures/binary-tree/bst.d.ts +2 -2
  117. package/dist/mjs/types/data-structures/hash/hash-map.d.ts +1 -2
  118. package/dist/mjs/types/data-structures/heap/heap.d.ts +4 -1
  119. package/dist/mjs/types/data-structures/priority-queue/priority-queue.d.ts +2 -1
  120. package/dist/umd/data-structure-typed.js +629 -595
  121. package/dist/umd/data-structure-typed.min.js +2 -2
  122. package/dist/umd/data-structure-typed.min.js.map +1 -1
  123. package/package.json +1 -1
  124. package/src/data-structures/binary-tree/avl-tree.ts +61 -31
  125. package/src/data-structures/binary-tree/binary-tree.ts +283 -254
  126. package/src/data-structures/binary-tree/bst.ts +193 -170
  127. package/src/data-structures/binary-tree/rb-tree.ts +87 -32
  128. package/src/data-structures/binary-tree/tree-multimap.ts +76 -136
  129. package/src/data-structures/graph/abstract-graph.ts +1 -1
  130. package/src/data-structures/hash/hash-map.ts +8 -8
  131. package/src/data-structures/heap/heap.ts +57 -39
  132. package/src/data-structures/heap/max-heap.ts +5 -5
  133. package/src/data-structures/heap/min-heap.ts +5 -5
  134. package/src/data-structures/linked-list/doubly-linked-list.ts +10 -1
  135. package/src/data-structures/linked-list/singly-linked-list.ts +9 -1
  136. package/src/data-structures/priority-queue/max-priority-queue.ts +4 -3
  137. package/src/data-structures/priority-queue/min-priority-queue.ts +12 -12
  138. package/src/data-structures/priority-queue/priority-queue.ts +3 -3
  139. package/src/data-structures/queue/deque.ts +4 -0
  140. package/src/data-structures/queue/queue.ts +4 -0
  141. package/src/data-structures/stack/stack.ts +12 -3
  142. package/src/data-structures/trie/trie.ts +23 -4
  143. package/src/interfaces/binary-tree.ts +14 -2
  144. package/src/types/common.ts +15 -1
  145. package/src/types/data-structures/binary-tree/binary-tree.ts +1 -1
  146. package/src/types/data-structures/binary-tree/bst.ts +2 -3
  147. package/src/types/data-structures/hash/hash-map.ts +1 -2
  148. package/src/types/data-structures/heap/heap.ts +3 -1
  149. package/src/types/data-structures/priority-queue/priority-queue.ts +3 -1
  150. package/test/integration/{all-in-one.ts → all-in-one.test.ts} +1 -1
  151. package/test/integration/index.html +87 -0
  152. package/test/performance/data-structures/comparison/comparison.test.ts +7 -6
  153. package/test/performance/data-structures/heap/heap.test.ts +2 -2
  154. package/test/performance/data-structures/priority-queue/priority-queue.test.ts +1 -1
  155. package/test/unit/data-structures/binary-tree/avl-tree.test.ts +20 -20
  156. package/test/unit/data-structures/binary-tree/binary-tree.test.ts +56 -57
  157. package/test/unit/data-structures/binary-tree/bst.test.ts +49 -54
  158. package/test/unit/data-structures/binary-tree/overall.test.ts +17 -18
  159. package/test/unit/data-structures/binary-tree/rb-tree.test.ts +3 -3
  160. package/test/unit/data-structures/binary-tree/tree-multimap.test.ts +118 -66
  161. package/test/unit/data-structures/heap/heap.test.ts +2 -2
  162. package/test/unit/data-structures/heap/max-heap.test.ts +1 -1
  163. package/test/unit/data-structures/heap/min-heap.test.ts +1 -1
  164. package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +4 -3
  165. package/test/unit/data-structures/priority-queue/priority-queue.test.ts +9 -10
  166. package/test/unit/data-structures/stack/stack.test.ts +2 -2
  167. package/test/unit/unrestricted-interconversion.test.ts +156 -0
  168. package/tsconfig-cjs.json +1 -1
  169. 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 = Array.isArray(elements) ? 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 - 1; i >= 0; i--) {
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 i of words) {
31
- this.add(i);
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 = true;
67
- return true;
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
- add(keyOrNode: BTNKey | N | null, value?: N['value']): N | null | undefined;
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?: 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
- export type BSTComparator = (a: BTNKey, b: BTNKey) => number;
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?: BSTComparator;
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, V> = {
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,4 @@
1
- export {};
1
+ import { Comparator } from "../../common";
2
+ export type HeapOptions<T> = {
3
+ comparator: Comparator<T>;
4
+ };
@@ -1 +1,2 @@
1
- export {};
1
+ import { HeapOptions } from "../heap";
2
+ export type PriorityQueueOptions<T> = HeapOptions<T> & {};