data-structure-typed 1.36.0 → 1.36.2
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 +4 -1
- package/dist/data-structures/binary-tree/avl-tree.d.ts +3 -3
- package/dist/data-structures/binary-tree/avl-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/binary-tree.d.ts +510 -5
- package/dist/data-structures/binary-tree/binary-tree.js +1174 -5
- package/dist/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/bst.d.ts +3 -3
- package/dist/data-structures/binary-tree/bst.js.map +1 -1
- package/dist/data-structures/binary-tree/index.d.ts +0 -5
- package/dist/data-structures/binary-tree/index.js +0 -5
- package/dist/data-structures/binary-tree/index.js.map +1 -1
- package/dist/data-structures/binary-tree/rb-tree.d.ts +3 -3
- package/dist/data-structures/binary-tree/rb-tree.js.map +1 -1
- package/dist/data-structures/binary-tree/tree-multiset.d.ts +3 -3
- package/dist/data-structures/binary-tree/tree-multiset.js.map +1 -1
- package/dist/data-structures/graph/abstract-graph.d.ts +2 -2
- package/dist/data-structures/graph/directed-graph.d.ts +2 -2
- package/dist/data-structures/graph/map-graph.d.ts +1 -1
- package/dist/data-structures/graph/map-graph.js +1 -1
- package/dist/data-structures/graph/undirected-graph.d.ts +2 -2
- package/dist/data-structures/hash/index.d.ts +0 -1
- package/dist/data-structures/hash/index.js +0 -1
- package/dist/data-structures/hash/index.js.map +1 -1
- package/dist/data-structures/heap/heap.d.ts +23 -24
- package/dist/data-structures/heap/heap.js +8 -25
- package/dist/data-structures/heap/heap.js.map +1 -1
- package/dist/data-structures/heap/max-heap.d.ts +3 -3
- package/dist/data-structures/heap/max-heap.js.map +1 -1
- package/dist/data-structures/heap/min-heap.d.ts +3 -3
- package/dist/data-structures/heap/min-heap.js.map +1 -1
- package/dist/data-structures/priority-queue/max-priority-queue.d.ts +3 -3
- package/dist/data-structures/priority-queue/max-priority-queue.js.map +1 -1
- package/dist/data-structures/priority-queue/min-priority-queue.d.ts +3 -3
- package/dist/data-structures/priority-queue/min-priority-queue.js.map +1 -1
- package/dist/data-structures/priority-queue/priority-queue.d.ts +3 -3
- package/dist/data-structures/priority-queue/priority-queue.js.map +1 -1
- package/dist/interfaces/binary-tree.d.ts +5 -4
- package/dist/interfaces/{abstract-graph.d.ts → graph.d.ts} +1 -1
- package/dist/interfaces/{bst.js → graph.js} +1 -1
- package/dist/interfaces/graph.js.map +1 -0
- package/dist/interfaces/index.d.ts +1 -8
- package/dist/interfaces/index.js +1 -8
- package/dist/interfaces/index.js.map +1 -1
- package/dist/types/data-structures/abstract-graph.d.ts +0 -1
- package/dist/types/data-structures/binary-tree.d.ts +32 -2
- package/dist/types/data-structures/binary-tree.js +22 -0
- package/dist/types/data-structures/binary-tree.js.map +1 -1
- package/dist/types/data-structures/bst.d.ts +1 -2
- package/dist/types/data-structures/heap.d.ts +2 -1
- package/dist/types/data-structures/index.d.ts +0 -2
- package/dist/types/data-structures/index.js +0 -2
- package/dist/types/data-structures/index.js.map +1 -1
- package/lib/data-structures/binary-tree/avl-tree.d.ts +3 -3
- package/lib/data-structures/binary-tree/binary-tree.d.ts +510 -5
- package/lib/data-structures/binary-tree/binary-tree.js +1174 -5
- package/lib/data-structures/binary-tree/bst.d.ts +3 -3
- package/lib/data-structures/binary-tree/index.d.ts +0 -5
- package/lib/data-structures/binary-tree/index.js +0 -5
- package/lib/data-structures/binary-tree/rb-tree.d.ts +3 -3
- package/lib/data-structures/binary-tree/tree-multiset.d.ts +3 -3
- package/lib/data-structures/graph/abstract-graph.d.ts +2 -2
- package/lib/data-structures/graph/directed-graph.d.ts +2 -2
- package/lib/data-structures/graph/map-graph.d.ts +1 -1
- package/lib/data-structures/graph/map-graph.js +1 -1
- package/lib/data-structures/graph/undirected-graph.d.ts +2 -2
- package/lib/data-structures/hash/index.d.ts +0 -1
- package/lib/data-structures/hash/index.js +0 -1
- package/lib/data-structures/heap/heap.d.ts +23 -24
- package/lib/data-structures/heap/heap.js +8 -25
- package/lib/data-structures/heap/max-heap.d.ts +3 -3
- package/lib/data-structures/heap/min-heap.d.ts +3 -3
- package/lib/data-structures/priority-queue/max-priority-queue.d.ts +3 -3
- package/lib/data-structures/priority-queue/min-priority-queue.d.ts +3 -3
- package/lib/data-structures/priority-queue/priority-queue.d.ts +3 -3
- package/lib/interfaces/binary-tree.d.ts +5 -4
- package/lib/interfaces/{abstract-graph.d.ts → graph.d.ts} +1 -1
- package/lib/interfaces/index.d.ts +1 -8
- package/lib/interfaces/index.js +1 -8
- package/lib/types/data-structures/abstract-graph.d.ts +0 -1
- package/lib/types/data-structures/binary-tree.d.ts +32 -2
- package/lib/types/data-structures/binary-tree.js +21 -1
- package/lib/types/data-structures/bst.d.ts +1 -2
- package/lib/types/data-structures/heap.d.ts +2 -1
- package/lib/types/data-structures/index.d.ts +0 -2
- package/lib/types/data-structures/index.js +0 -2
- package/package.json +4 -4
- package/src/data-structures/binary-tree/avl-tree.ts +6 -6
- package/src/data-structures/binary-tree/binary-tree.ts +1523 -14
- package/src/data-structures/binary-tree/bst.ts +3 -6
- package/src/data-structures/binary-tree/index.ts +0 -5
- package/src/data-structures/binary-tree/rb-tree.ts +6 -6
- package/src/data-structures/binary-tree/tree-multiset.ts +6 -6
- package/src/data-structures/graph/abstract-graph.ts +2 -2
- package/src/data-structures/graph/directed-graph.ts +2 -2
- package/src/data-structures/graph/map-graph.ts +1 -1
- package/src/data-structures/graph/undirected-graph.ts +2 -2
- package/src/data-structures/hash/index.ts +0 -1
- package/src/data-structures/heap/heap.ts +30 -48
- package/src/data-structures/heap/max-heap.ts +3 -3
- package/src/data-structures/heap/min-heap.ts +3 -3
- package/src/data-structures/priority-queue/max-priority-queue.ts +3 -3
- package/src/data-structures/priority-queue/min-priority-queue.ts +3 -3
- package/src/data-structures/priority-queue/priority-queue.ts +3 -3
- package/src/interfaces/binary-tree.ts +7 -4
- package/src/interfaces/{abstract-graph.ts → graph.ts} +1 -1
- package/src/interfaces/index.ts +1 -8
- package/src/types/data-structures/abstract-graph.ts +1 -1
- package/src/types/data-structures/binary-tree.ts +42 -2
- package/src/types/data-structures/bst.ts +2 -2
- package/src/types/data-structures/heap.ts +3 -1
- package/src/types/data-structures/index.ts +0 -2
- package/src/types/data-structures/navigator.ts +1 -0
- package/test/unit/data-structures/heap/max-heap.test.ts +2 -2
- package/test/unit/data-structures/heap/min-heap.test.ts +2 -2
- package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +2 -1
- package/test/unit/data-structures/priority-queue/min-priority-queue.test.ts +1 -1
- package/umd/bundle.min.js +1 -1
- package/umd/bundle.min.js.LICENSE.txt +7 -0
- package/umd/bundle.min.js.map +1 -1
- package/dist/data-structures/binary-tree/aa-tree.d.ts +0 -2
- package/dist/data-structures/binary-tree/aa-tree.js +0 -7
- package/dist/data-structures/binary-tree/aa-tree.js.map +0 -1
- package/dist/data-structures/binary-tree/abstract-binary-tree.d.ts +0 -527
- package/dist/data-structures/binary-tree/abstract-binary-tree.js +0 -1199
- package/dist/data-structures/binary-tree/abstract-binary-tree.js.map +0 -1
- package/dist/data-structures/binary-tree/b-tree.d.ts +0 -2
- package/dist/data-structures/binary-tree/b-tree.js +0 -7
- package/dist/data-structures/binary-tree/b-tree.js.map +0 -1
- package/dist/data-structures/binary-tree/splay-tree.d.ts +0 -2
- package/dist/data-structures/binary-tree/splay-tree.js +0 -7
- package/dist/data-structures/binary-tree/splay-tree.js.map +0 -1
- package/dist/data-structures/binary-tree/two-three-tree.d.ts +0 -2
- package/dist/data-structures/binary-tree/two-three-tree.js +0 -7
- package/dist/data-structures/binary-tree/two-three-tree.js.map +0 -1
- package/dist/data-structures/hash/pair.d.ts +0 -2
- package/dist/data-structures/hash/pair.js +0 -7
- package/dist/data-structures/hash/pair.js.map +0 -1
- package/dist/interfaces/abstract-binary-tree.d.ts +0 -7
- package/dist/interfaces/abstract-binary-tree.js +0 -3
- package/dist/interfaces/abstract-binary-tree.js.map +0 -1
- package/dist/interfaces/abstract-graph.js +0 -3
- package/dist/interfaces/abstract-graph.js.map +0 -1
- package/dist/interfaces/avl-tree.d.ts +0 -7
- package/dist/interfaces/avl-tree.js +0 -3
- package/dist/interfaces/avl-tree.js.map +0 -1
- package/dist/interfaces/bst.d.ts +0 -6
- package/dist/interfaces/bst.js.map +0 -1
- package/dist/interfaces/directed-graph.d.ts +0 -3
- package/dist/interfaces/directed-graph.js +0 -3
- package/dist/interfaces/directed-graph.js.map +0 -1
- package/dist/interfaces/rb-tree.d.ts +0 -6
- package/dist/interfaces/rb-tree.js +0 -3
- package/dist/interfaces/rb-tree.js.map +0 -1
- package/dist/interfaces/tree-multiset.d.ts +0 -6
- package/dist/interfaces/tree-multiset.js +0 -3
- package/dist/interfaces/tree-multiset.js.map +0 -1
- package/dist/interfaces/undirected-graph.d.ts +0 -3
- package/dist/interfaces/undirected-graph.js +0 -3
- package/dist/interfaces/undirected-graph.js.map +0 -1
- package/dist/types/data-structures/abstract-binary-tree.d.ts +0 -34
- package/dist/types/data-structures/abstract-binary-tree.js +0 -25
- package/dist/types/data-structures/abstract-binary-tree.js.map +0 -1
- package/dist/types/data-structures/priority-queue.d.ts +0 -7
- package/dist/types/data-structures/priority-queue.js +0 -3
- package/dist/types/data-structures/priority-queue.js.map +0 -1
- package/lib/data-structures/binary-tree/aa-tree.d.ts +0 -2
- package/lib/data-structures/binary-tree/aa-tree.js +0 -2
- package/lib/data-structures/binary-tree/abstract-binary-tree.d.ts +0 -527
- package/lib/data-structures/binary-tree/abstract-binary-tree.js +0 -1193
- package/lib/data-structures/binary-tree/b-tree.d.ts +0 -2
- package/lib/data-structures/binary-tree/b-tree.js +0 -2
- package/lib/data-structures/binary-tree/splay-tree.d.ts +0 -2
- package/lib/data-structures/binary-tree/splay-tree.js +0 -2
- package/lib/data-structures/binary-tree/two-three-tree.d.ts +0 -2
- package/lib/data-structures/binary-tree/two-three-tree.js +0 -2
- package/lib/data-structures/hash/pair.d.ts +0 -2
- package/lib/data-structures/hash/pair.js +0 -2
- package/lib/interfaces/abstract-binary-tree.d.ts +0 -7
- package/lib/interfaces/abstract-graph.js +0 -1
- package/lib/interfaces/avl-tree.d.ts +0 -7
- package/lib/interfaces/avl-tree.js +0 -1
- package/lib/interfaces/bst.d.ts +0 -6
- package/lib/interfaces/bst.js +0 -1
- package/lib/interfaces/directed-graph.d.ts +0 -3
- package/lib/interfaces/directed-graph.js +0 -1
- package/lib/interfaces/rb-tree.d.ts +0 -6
- package/lib/interfaces/rb-tree.js +0 -1
- package/lib/interfaces/tree-multiset.d.ts +0 -6
- package/lib/interfaces/tree-multiset.js +0 -1
- package/lib/interfaces/undirected-graph.d.ts +0 -3
- package/lib/interfaces/undirected-graph.js +0 -1
- package/lib/types/data-structures/abstract-binary-tree.d.ts +0 -34
- package/lib/types/data-structures/abstract-binary-tree.js +0 -21
- package/lib/types/data-structures/priority-queue.d.ts +0 -7
- package/lib/types/data-structures/priority-queue.js +0 -1
- package/src/data-structures/binary-tree/aa-tree.ts +0 -1
- package/src/data-structures/binary-tree/abstract-binary-tree.ts +0 -1556
- package/src/data-structures/binary-tree/b-tree.ts +0 -1
- package/src/data-structures/binary-tree/splay-tree.ts +0 -1
- package/src/data-structures/binary-tree/two-three-tree.ts +0 -1
- package/src/data-structures/hash/pair.ts +0 -1
- package/src/interfaces/abstract-binary-tree.ts +0 -8
- package/src/interfaces/avl-tree.ts +0 -8
- package/src/interfaces/bst.ts +0 -6
- package/src/interfaces/directed-graph.ts +0 -3
- package/src/interfaces/rb-tree.ts +0 -6
- package/src/interfaces/tree-multiset.ts +0 -7
- package/src/interfaces/undirected-graph.ts +0 -3
- package/src/types/data-structures/abstract-binary-tree.ts +0 -49
- package/src/types/data-structures/priority-queue.ts +0 -9
- /package/lib/interfaces/{abstract-binary-tree.js → graph.js} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BinaryTreeNodeKey } from '../types';
|
|
2
|
-
import { AbstractBinaryTreeNode } from '../data-structures';
|
|
3
|
-
export interface IAbstractBinaryTreeNode<T, NEIGHBOR extends IAbstractBinaryTreeNode<T, NEIGHBOR>> {
|
|
4
|
-
}
|
|
5
|
-
export interface IAbstractBinaryTree<N extends AbstractBinaryTreeNode<N['val'], N>> {
|
|
6
|
-
createNode(key: BinaryTreeNodeKey, val?: N['val'], count?: number): N | null;
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { AVLTreeNode } from '../data-structures';
|
|
2
|
-
import { IBST, IBSTNode } from './bst';
|
|
3
|
-
export interface IAVLTreeNode<T, NEIGHBOR extends IAVLTreeNode<T, NEIGHBOR>> extends IBSTNode<T, NEIGHBOR> {
|
|
4
|
-
height: number;
|
|
5
|
-
}
|
|
6
|
-
export interface IAVLTree<N extends AVLTreeNode<N['val'], N>> extends IBST<N> {
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/lib/interfaces/bst.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { BSTNode } from '../data-structures';
|
|
2
|
-
import { IBinaryTree, IBinaryTreeNode } from './binary-tree';
|
|
3
|
-
export interface IBSTNode<T, NEIGHBOR extends IBSTNode<T, NEIGHBOR>> extends IBinaryTreeNode<T, NEIGHBOR> {
|
|
4
|
-
}
|
|
5
|
-
export interface IBST<N extends BSTNode<N['val'], N>> extends IBinaryTree<N> {
|
|
6
|
-
}
|
package/lib/interfaces/bst.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { RBTreeNode } from '../data-structures';
|
|
2
|
-
import { IBST, IBSTNode } from './bst';
|
|
3
|
-
export interface IRBTreeNode<T, NEIGHBOR extends IRBTreeNode<T, NEIGHBOR>> extends IBSTNode<T, NEIGHBOR> {
|
|
4
|
-
}
|
|
5
|
-
export interface IRBTree<N extends RBTreeNode<N['val'], N>> extends IBST<N> {
|
|
6
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { TreeMultisetNode } from '../data-structures';
|
|
2
|
-
import { IAVLTree, IAVLTreeNode } from './avl-tree';
|
|
3
|
-
export interface ITreeMultisetNode<T, NEIGHBOR extends ITreeMultisetNode<T, NEIGHBOR>> extends IAVLTreeNode<T, NEIGHBOR> {
|
|
4
|
-
}
|
|
5
|
-
export interface ITreeMultiset<N extends TreeMultisetNode<N['val'], N>> extends IAVLTree<N> {
|
|
6
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { AbstractBinaryTreeNode } from '../../data-structures';
|
|
2
|
-
/**
|
|
3
|
-
* Enum representing different loop types.
|
|
4
|
-
*
|
|
5
|
-
* - `iterative`: Indicates the iterative loop type (with loops that use iterations).
|
|
6
|
-
* - `recursive`: Indicates the recursive loop type (with loops that call themselves).
|
|
7
|
-
*/
|
|
8
|
-
export declare enum LoopType {
|
|
9
|
-
ITERATIVE = "ITERATIVE",
|
|
10
|
-
RECURSIVE = "RECURSIVE"
|
|
11
|
-
}
|
|
12
|
-
export declare enum FamilyPosition {
|
|
13
|
-
ROOT = "ROOT",
|
|
14
|
-
LEFT = "LEFT",
|
|
15
|
-
RIGHT = "RIGHT",
|
|
16
|
-
ROOT_LEFT = "ROOT_LEFT",
|
|
17
|
-
ROOT_RIGHT = "ROOT_RIGHT",
|
|
18
|
-
ISOLATED = "ISOLATED",
|
|
19
|
-
MAL_NODE = "MAL_NODE"
|
|
20
|
-
}
|
|
21
|
-
export type BinaryTreeNodePropertyName = 'key' | 'val';
|
|
22
|
-
export type NodeOrPropertyName = 'node' | BinaryTreeNodePropertyName;
|
|
23
|
-
export type DFSOrderPattern = 'in' | 'pre' | 'post';
|
|
24
|
-
export type BinaryTreeNodeKey = number;
|
|
25
|
-
export type BinaryTreeDeletedResult<N> = {
|
|
26
|
-
deleted: N | null | undefined;
|
|
27
|
-
needBalanced: N | null;
|
|
28
|
-
};
|
|
29
|
-
export type AbstractBinaryTreeNodeProperty<N extends AbstractBinaryTreeNode<N['val'], N>> = N['val'] | N | number | BinaryTreeNodeKey;
|
|
30
|
-
export type AbstractBinaryTreeNodeProperties<N extends AbstractBinaryTreeNode<N['val'], N>> = AbstractBinaryTreeNodeProperty<N>[];
|
|
31
|
-
export type AbstractBinaryTreeNodeNested<T> = AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, AbstractBinaryTreeNode<T, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
|
|
32
|
-
export type AbstractBinaryTreeOptions = {
|
|
33
|
-
loopType?: LoopType;
|
|
34
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Enum representing different loop types.
|
|
3
|
-
*
|
|
4
|
-
* - `iterative`: Indicates the iterative loop type (with loops that use iterations).
|
|
5
|
-
* - `recursive`: Indicates the recursive loop type (with loops that call themselves).
|
|
6
|
-
*/
|
|
7
|
-
export var LoopType;
|
|
8
|
-
(function (LoopType) {
|
|
9
|
-
LoopType["ITERATIVE"] = "ITERATIVE";
|
|
10
|
-
LoopType["RECURSIVE"] = "RECURSIVE";
|
|
11
|
-
})(LoopType || (LoopType = {}));
|
|
12
|
-
export var FamilyPosition;
|
|
13
|
-
(function (FamilyPosition) {
|
|
14
|
-
FamilyPosition["ROOT"] = "ROOT";
|
|
15
|
-
FamilyPosition["LEFT"] = "LEFT";
|
|
16
|
-
FamilyPosition["RIGHT"] = "RIGHT";
|
|
17
|
-
FamilyPosition["ROOT_LEFT"] = "ROOT_LEFT";
|
|
18
|
-
FamilyPosition["ROOT_RIGHT"] = "ROOT_RIGHT";
|
|
19
|
-
FamilyPosition["ISOLATED"] = "ISOLATED";
|
|
20
|
-
FamilyPosition["MAL_NODE"] = "MAL_NODE";
|
|
21
|
-
})(FamilyPosition || (FamilyPosition = {}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export class AaTree {}
|