data-structure-typed 1.47.5 → 1.47.6

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 (139) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/cjs/data-structures/binary-tree/avl-tree.d.ts +8 -8
  3. package/dist/cjs/data-structures/binary-tree/avl-tree.js +23 -15
  4. package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -1
  5. package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +65 -28
  6. package/dist/cjs/data-structures/binary-tree/binary-tree.js +66 -82
  7. package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -1
  8. package/dist/cjs/data-structures/binary-tree/bst.d.ts +38 -37
  9. package/dist/cjs/data-structures/binary-tree/bst.js +56 -40
  10. package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -1
  11. package/dist/cjs/data-structures/binary-tree/rb-tree.d.ts +11 -7
  12. package/dist/cjs/data-structures/binary-tree/rb-tree.js +26 -17
  13. package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -1
  14. package/dist/cjs/data-structures/binary-tree/tree-multimap.d.ts +16 -16
  15. package/dist/cjs/data-structures/binary-tree/tree-multimap.js +31 -22
  16. package/dist/cjs/data-structures/binary-tree/tree-multimap.js.map +1 -1
  17. package/dist/cjs/data-structures/graph/abstract-graph.js +1 -1
  18. package/dist/cjs/data-structures/graph/abstract-graph.js.map +1 -1
  19. package/dist/cjs/data-structures/heap/heap.d.ts +19 -21
  20. package/dist/cjs/data-structures/heap/heap.js +52 -34
  21. package/dist/cjs/data-structures/heap/heap.js.map +1 -1
  22. package/dist/cjs/data-structures/heap/max-heap.d.ts +2 -5
  23. package/dist/cjs/data-structures/heap/max-heap.js +2 -2
  24. package/dist/cjs/data-structures/heap/max-heap.js.map +1 -1
  25. package/dist/cjs/data-structures/heap/min-heap.d.ts +2 -5
  26. package/dist/cjs/data-structures/heap/min-heap.js +2 -2
  27. package/dist/cjs/data-structures/heap/min-heap.js.map +1 -1
  28. package/dist/cjs/data-structures/linked-list/doubly-linked-list.d.ts +2 -1
  29. package/dist/cjs/data-structures/linked-list/doubly-linked-list.js +9 -1
  30. package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +1 -1
  31. package/dist/cjs/data-structures/linked-list/singly-linked-list.d.ts +2 -1
  32. package/dist/cjs/data-structures/linked-list/singly-linked-list.js +8 -1
  33. package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -1
  34. package/dist/cjs/data-structures/priority-queue/max-priority-queue.d.ts +2 -5
  35. package/dist/cjs/data-structures/priority-queue/max-priority-queue.js +2 -2
  36. package/dist/cjs/data-structures/priority-queue/max-priority-queue.js.map +1 -1
  37. package/dist/cjs/data-structures/priority-queue/min-priority-queue.d.ts +2 -5
  38. package/dist/cjs/data-structures/priority-queue/min-priority-queue.js +2 -2
  39. package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +1 -1
  40. package/dist/cjs/data-structures/priority-queue/priority-queue.d.ts +2 -5
  41. package/dist/cjs/data-structures/priority-queue/priority-queue.js +2 -2
  42. package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +1 -1
  43. package/dist/cjs/data-structures/queue/deque.d.ts +1 -0
  44. package/dist/cjs/data-structures/queue/deque.js +3 -0
  45. package/dist/cjs/data-structures/queue/deque.js.map +1 -1
  46. package/dist/cjs/data-structures/queue/queue.d.ts +1 -0
  47. package/dist/cjs/data-structures/queue/queue.js +3 -0
  48. package/dist/cjs/data-structures/queue/queue.js.map +1 -1
  49. package/dist/cjs/data-structures/stack/stack.d.ts +2 -1
  50. package/dist/cjs/data-structures/stack/stack.js +10 -2
  51. package/dist/cjs/data-structures/stack/stack.js.map +1 -1
  52. package/dist/cjs/interfaces/binary-tree.d.ts +3 -1
  53. package/dist/cjs/types/common.d.ts +2 -0
  54. package/dist/cjs/types/common.js.map +1 -1
  55. package/dist/cjs/types/data-structures/binary-tree/binary-tree.d.ts +1 -1
  56. package/dist/cjs/types/data-structures/binary-tree/bst.d.ts +2 -2
  57. package/dist/cjs/types/data-structures/heap/heap.d.ts +4 -1
  58. package/dist/cjs/types/data-structures/priority-queue/priority-queue.d.ts +2 -1
  59. package/dist/mjs/data-structures/binary-tree/avl-tree.d.ts +8 -8
  60. package/dist/mjs/data-structures/binary-tree/avl-tree.js +26 -16
  61. package/dist/mjs/data-structures/binary-tree/binary-tree.d.ts +65 -28
  62. package/dist/mjs/data-structures/binary-tree/binary-tree.js +66 -83
  63. package/dist/mjs/data-structures/binary-tree/bst.d.ts +38 -37
  64. package/dist/mjs/data-structures/binary-tree/bst.js +59 -41
  65. package/dist/mjs/data-structures/binary-tree/rb-tree.d.ts +11 -7
  66. package/dist/mjs/data-structures/binary-tree/rb-tree.js +30 -19
  67. package/dist/mjs/data-structures/binary-tree/tree-multimap.d.ts +16 -16
  68. package/dist/mjs/data-structures/binary-tree/tree-multimap.js +34 -23
  69. package/dist/mjs/data-structures/graph/abstract-graph.js +1 -1
  70. package/dist/mjs/data-structures/heap/heap.d.ts +19 -21
  71. package/dist/mjs/data-structures/heap/heap.js +53 -35
  72. package/dist/mjs/data-structures/heap/max-heap.d.ts +2 -5
  73. package/dist/mjs/data-structures/heap/max-heap.js +2 -2
  74. package/dist/mjs/data-structures/heap/min-heap.d.ts +2 -5
  75. package/dist/mjs/data-structures/heap/min-heap.js +2 -2
  76. package/dist/mjs/data-structures/linked-list/doubly-linked-list.d.ts +2 -1
  77. package/dist/mjs/data-structures/linked-list/doubly-linked-list.js +9 -1
  78. package/dist/mjs/data-structures/linked-list/singly-linked-list.d.ts +2 -1
  79. package/dist/mjs/data-structures/linked-list/singly-linked-list.js +8 -1
  80. package/dist/mjs/data-structures/priority-queue/max-priority-queue.d.ts +2 -5
  81. package/dist/mjs/data-structures/priority-queue/max-priority-queue.js +2 -2
  82. package/dist/mjs/data-structures/priority-queue/min-priority-queue.d.ts +2 -5
  83. package/dist/mjs/data-structures/priority-queue/min-priority-queue.js +2 -2
  84. package/dist/mjs/data-structures/priority-queue/priority-queue.d.ts +2 -5
  85. package/dist/mjs/data-structures/priority-queue/priority-queue.js +2 -2
  86. package/dist/mjs/data-structures/queue/deque.d.ts +1 -0
  87. package/dist/mjs/data-structures/queue/deque.js +3 -0
  88. package/dist/mjs/data-structures/queue/queue.d.ts +1 -0
  89. package/dist/mjs/data-structures/queue/queue.js +3 -0
  90. package/dist/mjs/data-structures/stack/stack.d.ts +2 -1
  91. package/dist/mjs/data-structures/stack/stack.js +10 -2
  92. package/dist/mjs/interfaces/binary-tree.d.ts +3 -1
  93. package/dist/mjs/types/common.d.ts +2 -0
  94. package/dist/mjs/types/data-structures/binary-tree/binary-tree.d.ts +1 -1
  95. package/dist/mjs/types/data-structures/binary-tree/bst.d.ts +2 -2
  96. package/dist/mjs/types/data-structures/heap/heap.d.ts +4 -1
  97. package/dist/mjs/types/data-structures/priority-queue/priority-queue.d.ts +2 -1
  98. package/dist/umd/data-structure-typed.js +307 -229
  99. package/dist/umd/data-structure-typed.min.js +2 -2
  100. package/dist/umd/data-structure-typed.min.js.map +1 -1
  101. package/package.json +1 -1
  102. package/src/data-structures/binary-tree/avl-tree.ts +27 -17
  103. package/src/data-structures/binary-tree/binary-tree.ts +114 -97
  104. package/src/data-structures/binary-tree/bst.ts +67 -47
  105. package/src/data-structures/binary-tree/rb-tree.ts +34 -20
  106. package/src/data-structures/binary-tree/tree-multimap.ts +43 -25
  107. package/src/data-structures/graph/abstract-graph.ts +1 -1
  108. package/src/data-structures/heap/heap.ts +57 -39
  109. package/src/data-structures/heap/max-heap.ts +5 -5
  110. package/src/data-structures/heap/min-heap.ts +5 -5
  111. package/src/data-structures/linked-list/doubly-linked-list.ts +10 -1
  112. package/src/data-structures/linked-list/singly-linked-list.ts +9 -1
  113. package/src/data-structures/priority-queue/max-priority-queue.ts +4 -3
  114. package/src/data-structures/priority-queue/min-priority-queue.ts +12 -12
  115. package/src/data-structures/priority-queue/priority-queue.ts +3 -3
  116. package/src/data-structures/queue/deque.ts +4 -0
  117. package/src/data-structures/queue/queue.ts +4 -0
  118. package/src/data-structures/stack/stack.ts +12 -3
  119. package/src/interfaces/binary-tree.ts +13 -1
  120. package/src/types/common.ts +5 -1
  121. package/src/types/data-structures/binary-tree/binary-tree.ts +1 -1
  122. package/src/types/data-structures/binary-tree/bst.ts +2 -3
  123. package/src/types/data-structures/heap/heap.ts +3 -1
  124. package/src/types/data-structures/priority-queue/priority-queue.ts +3 -1
  125. package/test/performance/data-structures/comparison/comparison.test.ts +7 -6
  126. package/test/performance/data-structures/heap/heap.test.ts +2 -2
  127. package/test/performance/data-structures/priority-queue/priority-queue.test.ts +1 -1
  128. package/test/unit/data-structures/binary-tree/avl-tree.test.ts +1 -1
  129. package/test/unit/data-structures/binary-tree/binary-tree.test.ts +6 -6
  130. package/test/unit/data-structures/binary-tree/bst.test.ts +1 -1
  131. package/test/unit/data-structures/binary-tree/tree-multimap.test.ts +1 -1
  132. package/test/unit/data-structures/heap/heap.test.ts +2 -2
  133. package/test/unit/data-structures/heap/max-heap.test.ts +1 -1
  134. package/test/unit/data-structures/heap/min-heap.test.ts +1 -1
  135. package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +4 -3
  136. package/test/unit/data-structures/priority-queue/priority-queue.test.ts +9 -10
  137. package/test/unit/data-structures/stack/stack.test.ts +2 -2
  138. package/test/unit/unrestricted-interconversion.test.ts +100 -0
  139. package/test/integration/conversion.test.ts +0 -0
@@ -22,10 +22,14 @@ export class SinglyLinkedList {
22
22
  /**
23
23
  * The constructor initializes the linked list with an empty head, tail, and length.
24
24
  */
25
- constructor() {
25
+ constructor(elements) {
26
26
  this._head = null;
27
27
  this._tail = null;
28
28
  this._length = 0;
29
+ if (elements) {
30
+ for (const el of elements)
31
+ this.push(el);
32
+ }
29
33
  }
30
34
  _head;
31
35
  get head() {
@@ -710,4 +714,7 @@ export class SinglyLinkedList {
710
714
  }
711
715
  return accumulator;
712
716
  }
717
+ print() {
718
+ console.log([...this]);
719
+ }
713
720
  }
@@ -6,10 +6,7 @@
6
6
  * @license MIT License
7
7
  */
8
8
  import { PriorityQueue } from './priority-queue';
9
- import type { Comparator } from '../../types';
9
+ import type { PriorityQueueOptions } from '../../types';
10
10
  export declare class MaxPriorityQueue<E = any> extends PriorityQueue<E> {
11
- constructor(options?: {
12
- comparator: Comparator<E>;
13
- nodes?: E[];
14
- });
11
+ constructor(elements?: Iterable<E>, options?: PriorityQueueOptions<E>);
15
12
  }
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { PriorityQueue } from './priority-queue';
9
9
  export class MaxPriorityQueue extends PriorityQueue {
10
- constructor(options = {
10
+ constructor(elements, options = {
11
11
  comparator: (a, b) => {
12
12
  if (!(typeof a === 'number' && typeof b === 'number')) {
13
13
  throw new Error('The a, b params of compare function must be number');
@@ -17,6 +17,6 @@ export class MaxPriorityQueue extends PriorityQueue {
17
17
  }
18
18
  }
19
19
  }) {
20
- super(options);
20
+ super(elements, options);
21
21
  }
22
22
  }
@@ -6,10 +6,7 @@
6
6
  * @license MIT License
7
7
  */
8
8
  import { PriorityQueue } from './priority-queue';
9
- import type { Comparator } from '../../types';
9
+ import type { PriorityQueueOptions } from '../../types';
10
10
  export declare class MinPriorityQueue<E = any> extends PriorityQueue<E> {
11
- constructor(options?: {
12
- comparator: Comparator<E>;
13
- nodes?: E[];
14
- });
11
+ constructor(elements?: Iterable<E>, options?: PriorityQueueOptions<E>);
15
12
  }
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { PriorityQueue } from './priority-queue';
9
9
  export class MinPriorityQueue extends PriorityQueue {
10
- constructor(options = {
10
+ constructor(elements, options = {
11
11
  comparator: (a, b) => {
12
12
  if (!(typeof a === 'number' && typeof b === 'number')) {
13
13
  throw new Error('The a, b params of compare function must be number');
@@ -17,6 +17,6 @@ export class MinPriorityQueue extends PriorityQueue {
17
17
  }
18
18
  }
19
19
  }) {
20
- super(options);
20
+ super(elements, options);
21
21
  }
22
22
  }
@@ -6,10 +6,7 @@
6
6
  * @license MIT License
7
7
  */
8
8
  import { Heap } from '../heap';
9
- import { Comparator } from '../../types';
9
+ import { PriorityQueueOptions } from '../../types';
10
10
  export declare class PriorityQueue<E = any> extends Heap<E> {
11
- constructor(options: {
12
- comparator: Comparator<E>;
13
- nodes?: E[];
14
- });
11
+ constructor(elements?: Iterable<E>, options?: PriorityQueueOptions<E>);
15
12
  }
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { Heap } from '../heap';
9
9
  export class PriorityQueue extends Heap {
10
- constructor(options) {
11
- super(options);
10
+ constructor(elements, options) {
11
+ super(elements, options);
12
12
  }
13
13
  }
@@ -428,6 +428,7 @@ export declare class Deque<E> {
428
428
  * applying the callback function to each element.
429
429
  */
430
430
  reduce<T>(callback: (accumulator: T, element: E, index: number, deque: this) => T, initialValue: T): T;
431
+ print(): void;
431
432
  /**
432
433
  * Time Complexity: O(n)
433
434
  * Space Complexity: O(n)
@@ -759,6 +759,9 @@ export class Deque {
759
759
  }
760
760
  return accumulator;
761
761
  }
762
+ print() {
763
+ console.log([...this]);
764
+ }
762
765
  /**
763
766
  * Time Complexity: O(n)
764
767
  * Space Complexity: O(n)
@@ -205,6 +205,7 @@ export declare class Queue<E = any> {
205
205
  * @returns The `clone()` method is returning a new instance of the `Queue` class.
206
206
  */
207
207
  clone(): Queue<E>;
208
+ print(): void;
208
209
  [Symbol.iterator](): Generator<E, void, unknown>;
209
210
  /**
210
211
  * Time Complexity: O(n)
@@ -262,6 +262,9 @@ export class Queue {
262
262
  clone() {
263
263
  return new Queue(this.nodes.slice(this.offset));
264
264
  }
265
+ print() {
266
+ console.log([...this]);
267
+ }
265
268
  *[Symbol.iterator]() {
266
269
  for (const item of this.nodes) {
267
270
  yield item;
@@ -10,7 +10,7 @@ export declare class Stack<E = any> {
10
10
  * of elements of type `E`. It is used to initialize the `_elements` property of the class. If the `elements` parameter
11
11
  * is provided and is an array, it is assigned to the `_elements
12
12
  */
13
- constructor(elements?: E[]);
13
+ constructor(elements?: Iterable<E>);
14
14
  protected _elements: E[];
15
15
  get elements(): E[];
16
16
  /**
@@ -116,4 +116,5 @@ export declare class Stack<E = any> {
116
116
  filter(predicate: (element: E, index: number, stack: this) => boolean): Stack<E>;
117
117
  map<T>(callback: (element: E, index: number, stack: this) => T): Stack<T>;
118
118
  reduce<T>(callback: (accumulator: T, element: E, index: number, stack: this) => T, initialValue: T): T;
119
+ print(): void;
119
120
  }
@@ -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
  }
@@ -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, IterableEntriesOrKeys } 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
+ createTree(options?: Partial<BinaryTreeOptions>): TREE;
6
+ init(elements: IterableEntriesOrKeys<V>): void;
5
7
  add(keyOrNode: BTNKey | N | null, value?: N['value']): 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,4 @@ export type BinaryTreePrintOptions = {
18
19
  isShowNull?: boolean;
19
20
  isShowRedBlackNIL?: boolean;
20
21
  };
22
+ export type IterableEntriesOrKeys<T> = Iterable<[BTNKey, T | undefined] | BTNKey>;
@@ -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
  };
@@ -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> & {};