binary-tree-typed 1.53.7 → 1.54.0
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/dist/common/index.js +5 -0
- package/dist/data-structures/base/iterable-entry-base.js +4 -4
- package/dist/data-structures/binary-tree/avl-tree-multi-map.d.ts +34 -27
- package/dist/data-structures/binary-tree/avl-tree-multi-map.js +63 -53
- package/dist/data-structures/binary-tree/avl-tree.d.ts +3 -14
- package/dist/data-structures/binary-tree/avl-tree.js +22 -25
- package/dist/data-structures/binary-tree/binary-tree.d.ts +33 -17
- package/dist/data-structures/binary-tree/binary-tree.js +45 -26
- package/dist/data-structures/binary-tree/bst.d.ts +67 -46
- package/dist/data-structures/binary-tree/bst.js +87 -54
- package/dist/data-structures/binary-tree/index.d.ts +1 -1
- package/dist/data-structures/binary-tree/index.js +1 -1
- package/dist/data-structures/binary-tree/{rb-tree.d.ts → red-black-tree.d.ts} +75 -16
- package/dist/data-structures/binary-tree/{rb-tree.js → red-black-tree.js} +93 -60
- package/dist/data-structures/binary-tree/tree-multi-map.d.ts +20 -16
- package/dist/data-structures/binary-tree/tree-multi-map.js +41 -28
- package/dist/data-structures/graph/abstract-graph.js +2 -2
- package/dist/data-structures/hash/hash-map.d.ts +31 -1
- package/dist/data-structures/hash/hash-map.js +35 -5
- package/dist/data-structures/heap/heap.d.ts +20 -3
- package/dist/data-structures/heap/heap.js +31 -11
- package/dist/data-structures/linked-list/doubly-linked-list.d.ts +46 -11
- package/dist/data-structures/linked-list/doubly-linked-list.js +68 -21
- package/dist/data-structures/linked-list/singly-linked-list.d.ts +44 -11
- package/dist/data-structures/linked-list/singly-linked-list.js +70 -26
- package/dist/data-structures/queue/deque.d.ts +37 -8
- package/dist/data-structures/queue/deque.js +73 -29
- package/dist/data-structures/queue/queue.d.ts +41 -1
- package/dist/data-structures/queue/queue.js +51 -9
- package/dist/data-structures/stack/stack.d.ts +27 -10
- package/dist/data-structures/stack/stack.js +39 -20
- package/dist/data-structures/trie/trie.d.ts +8 -3
- package/dist/data-structures/trie/trie.js +8 -3
- package/dist/interfaces/binary-tree.d.ts +1 -1
- package/dist/types/data-structures/base/base.d.ts +1 -1
- package/dist/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +2 -2
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +2 -2
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +2 -2
- package/dist/types/data-structures/binary-tree/bst.d.ts +3 -3
- package/dist/types/data-structures/binary-tree/rb-tree.d.ts +3 -3
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +4 -4
- package/package.json +2 -2
- package/src/common/index.ts +7 -1
- package/src/data-structures/base/iterable-entry-base.ts +4 -4
- package/src/data-structures/binary-tree/avl-tree-multi-map.ts +84 -65
- package/src/data-structures/binary-tree/avl-tree.ts +40 -34
- package/src/data-structures/binary-tree/binary-tree.ts +76 -32
- package/src/data-structures/binary-tree/bst.ts +121 -68
- package/src/data-structures/binary-tree/index.ts +1 -1
- package/src/data-structures/binary-tree/{rb-tree.ts → red-black-tree.ts} +116 -71
- package/src/data-structures/binary-tree/tree-multi-map.ts +59 -33
- package/src/data-structures/graph/abstract-graph.ts +2 -2
- package/src/data-structures/hash/hash-map.ts +37 -7
- package/src/data-structures/heap/heap.ts +33 -10
- package/src/data-structures/linked-list/doubly-linked-list.ts +75 -21
- package/src/data-structures/linked-list/singly-linked-list.ts +77 -27
- package/src/data-structures/queue/deque.ts +72 -28
- package/src/data-structures/queue/queue.ts +50 -7
- package/src/data-structures/stack/stack.ts +39 -20
- package/src/data-structures/trie/trie.ts +8 -3
- package/src/interfaces/binary-tree.ts +4 -1
- package/src/types/data-structures/base/base.ts +1 -1
- package/src/types/data-structures/binary-tree/avl-tree-multi-map.ts +2 -2
- package/src/types/data-structures/binary-tree/avl-tree.ts +2 -2
- package/src/types/data-structures/binary-tree/binary-tree.ts +2 -2
- package/src/types/data-structures/binary-tree/bst.ts +3 -3
- package/src/types/data-structures/binary-tree/rb-tree.ts +3 -3
- package/src/types/data-structures/binary-tree/tree-multi-map.ts +4 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AVLTree, AVLTreeNode } from '../../../data-structures';
|
|
2
2
|
import { BSTOptions } from './bst';
|
|
3
3
|
|
|
4
|
-
export type AVLTreeNodeNested<K, V> = AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V,
|
|
4
|
+
export type AVLTreeNodeNested<K, V> = AVLTreeNode<K, V, AVLTreeNode<K, V, AVLTreeNode<K, V, any>>>
|
|
5
5
|
|
|
6
|
-
export type AVLTreeNested<K, V, R, NODE extends AVLTreeNode<K, V, NODE>> = AVLTree<K, V, R,
|
|
6
|
+
export type AVLTreeNested<K, V, R,MK, MV, MR, NODE extends AVLTreeNode<K, V, NODE>> = AVLTree<K, V, R,MK, MV, MR, NODE, AVLTree<K, V, R,MK, MV, MR, NODE, AVLTree<K, V, R,MK, MV, MR, NODE, any>>>
|
|
7
7
|
|
|
8
8
|
export type AVLTreeOptions<K, V, R> = BSTOptions<K, V, R> & {};
|
|
@@ -2,9 +2,9 @@ import { BinaryTree, BinaryTreeNode } from '../../../data-structures';
|
|
|
2
2
|
import { IterationType, OptValue } from '../../common';
|
|
3
3
|
import { DFSOperation } from '../../../common';
|
|
4
4
|
|
|
5
|
-
export type BinaryTreeNodeNested<K, V> = BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V,
|
|
5
|
+
export type BinaryTreeNodeNested<K, V> = BinaryTreeNode<K, V, BinaryTreeNode<K, V, BinaryTreeNode<K, V, any>>>
|
|
6
6
|
|
|
7
|
-
export type BinaryTreeNested<K, V, R,
|
|
7
|
+
export type BinaryTreeNested<K, V, R, MK, MV, MR, NODE extends BinaryTreeNode<K, V, NODE>> = BinaryTree<K, V, R, MK, MV, MR, NODE,BinaryTree<K, V, R, MK, MV, MR, NODE,BinaryTree<K, V, R, MK, MV, MR, NODE,any>>>
|
|
8
8
|
|
|
9
9
|
export type ToEntryFn<K, V, R> = (rawElement: R) => BTNEntry<K, V>;
|
|
10
10
|
|
|
@@ -2,12 +2,12 @@ import { BST, BSTNode } from '../../../data-structures';
|
|
|
2
2
|
import type { BinaryTreeOptions } from './binary-tree';
|
|
3
3
|
import { Comparable } from '../../utils';
|
|
4
4
|
|
|
5
|
-
export type BSTNodeNested<K, V> = BSTNode<K, V, BSTNode<K, V, BSTNode<K, V,
|
|
5
|
+
export type BSTNodeNested<K, V> = BSTNode<K, V, BSTNode<K, V, BSTNode<K, V, any>>>
|
|
6
6
|
|
|
7
|
-
export type BSTNested<K, V, R, NODE extends BSTNode<K, V, NODE>> = BST<K, V, R,
|
|
7
|
+
export type BSTNested<K, V, R,MK, MV, MR, NODE extends BSTNode<K, V, NODE>> = BST<K, V, R,MK, MV, MR, NODE,BST<K, V, R,MK, MV, MR, NODE,BST<K, V, R,MK, MV, MR, NODE, any>>>
|
|
8
8
|
|
|
9
9
|
export type BSTOptions<K, V, R> = BinaryTreeOptions<K, V, R> & {
|
|
10
|
-
|
|
10
|
+
specifyComparable?: (key: K) => Comparable
|
|
11
11
|
isReverse?: boolean;
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -3,8 +3,8 @@ import type { BSTOptions } from "./bst";
|
|
|
3
3
|
|
|
4
4
|
export type RBTNColor = 'RED' | 'BLACK';
|
|
5
5
|
|
|
6
|
-
export type RedBlackTreeNodeNested<K, V> = RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V,
|
|
6
|
+
export type RedBlackTreeNodeNested<K, V> = RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, RedBlackTreeNode<K, V, any>>>
|
|
7
7
|
|
|
8
|
-
export type RedBlackTreeNested<K, V, R,
|
|
8
|
+
export type RedBlackTreeNested<K, V, R, MK, MV, MR, NODE extends RedBlackTreeNode<K, V, NODE>> = RedBlackTree<K, V, R, MK, MV, MR, NODE, RedBlackTree<K, V, R, MK, MV, MR, NODE, RedBlackTree<K, V, R, MK, MV, MR, NODE, any>>>
|
|
9
9
|
|
|
10
|
-
export type
|
|
10
|
+
export type RedBlackTreeOptions<K, V, R> = BSTOptions<K, V, R> & {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TreeMultiMap, TreeMultiMapNode } from '../../../data-structures';
|
|
2
|
-
import type {
|
|
2
|
+
import type { RedBlackTreeOptions } from './rb-tree';
|
|
3
3
|
|
|
4
|
-
export type TreeMultiMapNodeNested<K, V> = TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V,
|
|
4
|
+
export type TreeMultiMapNodeNested<K, V> = TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, TreeMultiMapNode<K, V, any>>>
|
|
5
5
|
|
|
6
|
-
export type TreeMultiMapNested<K, V, R,
|
|
6
|
+
export type TreeMultiMapNested<K, V, R, MK, MV, MR, NODE extends TreeMultiMapNode<K, V, NODE>> = TreeMultiMap<K, V, R, MK, MV, MR, NODE, TreeMultiMap<K, V, R, MK, MV, MR, NODE,TreeMultiMap<K, V, R, MK, MV, MR, NODE, any>>>
|
|
7
7
|
|
|
8
|
-
export type TreeMultiMapOptions<K, V, R> =
|
|
8
|
+
export type TreeMultiMapOptions<K, V, R> = RedBlackTreeOptions<K, V, R> & {}
|