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.
- package/CHANGELOG.md +1 -1
- package/dist/cjs/data-structures/binary-tree/avl-tree.d.ts +8 -8
- package/dist/cjs/data-structures/binary-tree/avl-tree.js +23 -15
- package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +65 -28
- package/dist/cjs/data-structures/binary-tree/binary-tree.js +66 -82
- package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/bst.d.ts +38 -37
- package/dist/cjs/data-structures/binary-tree/bst.js +56 -40
- package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/rb-tree.d.ts +11 -7
- package/dist/cjs/data-structures/binary-tree/rb-tree.js +26 -17
- package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/tree-multimap.d.ts +16 -16
- package/dist/cjs/data-structures/binary-tree/tree-multimap.js +31 -22
- 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/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/interfaces/binary-tree.d.ts +3 -1
- package/dist/cjs/types/common.d.ts +2 -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/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 +8 -8
- package/dist/mjs/data-structures/binary-tree/avl-tree.js +26 -16
- package/dist/mjs/data-structures/binary-tree/binary-tree.d.ts +65 -28
- package/dist/mjs/data-structures/binary-tree/binary-tree.js +66 -83
- package/dist/mjs/data-structures/binary-tree/bst.d.ts +38 -37
- package/dist/mjs/data-structures/binary-tree/bst.js +59 -41
- package/dist/mjs/data-structures/binary-tree/rb-tree.d.ts +11 -7
- package/dist/mjs/data-structures/binary-tree/rb-tree.js +30 -19
- package/dist/mjs/data-structures/binary-tree/tree-multimap.d.ts +16 -16
- package/dist/mjs/data-structures/binary-tree/tree-multimap.js +34 -23
- package/dist/mjs/data-structures/graph/abstract-graph.js +1 -1
- 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/interfaces/binary-tree.d.ts +3 -1
- package/dist/mjs/types/common.d.ts +2 -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/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 +307 -229
- 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 +27 -17
- package/src/data-structures/binary-tree/binary-tree.ts +114 -97
- package/src/data-structures/binary-tree/bst.ts +67 -47
- package/src/data-structures/binary-tree/rb-tree.ts +34 -20
- package/src/data-structures/binary-tree/tree-multimap.ts +43 -25
- package/src/data-structures/graph/abstract-graph.ts +1 -1
- 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/interfaces/binary-tree.ts +13 -1
- package/src/types/common.ts +5 -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/heap/heap.ts +3 -1
- package/src/types/data-structures/priority-queue/priority-queue.ts +3 -1
- 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 +1 -1
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +6 -6
- package/test/unit/data-structures/binary-tree/bst.test.ts +1 -1
- package/test/unit/data-structures/binary-tree/tree-multimap.test.ts +1 -1
- 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 +100 -0
- 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 {
|
|
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 {
|
|
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 {
|
|
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
|
}
|
|
@@ -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)
|
|
@@ -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)
|
|
@@ -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 =
|
|
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
|
}
|
|
@@ -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
|
|
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
|
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { HeapOptions } from "../heap";
|
|
2
|
+
export type PriorityQueueOptions<T> = HeapOptions<T> & {};
|