data-structure-typed 1.36.1 → 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.
Files changed (206) hide show
  1. package/CHANGELOG.md +2 -1
  2. package/dist/data-structures/binary-tree/avl-tree.d.ts +3 -3
  3. package/dist/data-structures/binary-tree/avl-tree.js.map +1 -1
  4. package/dist/data-structures/binary-tree/binary-tree.d.ts +8 -8
  5. package/dist/data-structures/binary-tree/binary-tree.js +11 -13
  6. package/dist/data-structures/binary-tree/binary-tree.js.map +1 -1
  7. package/dist/data-structures/binary-tree/bst.d.ts +3 -3
  8. package/dist/data-structures/binary-tree/bst.js.map +1 -1
  9. package/dist/data-structures/binary-tree/index.d.ts +0 -5
  10. package/dist/data-structures/binary-tree/index.js +0 -5
  11. package/dist/data-structures/binary-tree/index.js.map +1 -1
  12. package/dist/data-structures/binary-tree/rb-tree.d.ts +3 -3
  13. package/dist/data-structures/binary-tree/rb-tree.js.map +1 -1
  14. package/dist/data-structures/binary-tree/tree-multiset.d.ts +3 -3
  15. package/dist/data-structures/binary-tree/tree-multiset.js.map +1 -1
  16. package/dist/data-structures/graph/abstract-graph.d.ts +2 -2
  17. package/dist/data-structures/graph/directed-graph.d.ts +2 -2
  18. package/dist/data-structures/graph/map-graph.d.ts +1 -1
  19. package/dist/data-structures/graph/map-graph.js +1 -1
  20. package/dist/data-structures/graph/undirected-graph.d.ts +2 -2
  21. package/dist/data-structures/hash/index.d.ts +0 -1
  22. package/dist/data-structures/hash/index.js +0 -1
  23. package/dist/data-structures/hash/index.js.map +1 -1
  24. package/dist/data-structures/heap/heap.d.ts +4 -4
  25. package/dist/data-structures/heap/heap.js.map +1 -1
  26. package/dist/data-structures/heap/max-heap.d.ts +2 -2
  27. package/dist/data-structures/heap/max-heap.js.map +1 -1
  28. package/dist/data-structures/heap/min-heap.d.ts +2 -2
  29. package/dist/data-structures/heap/min-heap.js.map +1 -1
  30. package/dist/data-structures/priority-queue/max-priority-queue.d.ts +2 -2
  31. package/dist/data-structures/priority-queue/max-priority-queue.js.map +1 -1
  32. package/dist/data-structures/priority-queue/min-priority-queue.d.ts +2 -2
  33. package/dist/data-structures/priority-queue/min-priority-queue.js.map +1 -1
  34. package/dist/data-structures/priority-queue/priority-queue.d.ts +2 -2
  35. package/dist/data-structures/priority-queue/priority-queue.js.map +1 -1
  36. package/dist/interfaces/binary-tree.d.ts +5 -4
  37. package/dist/interfaces/{abstract-graph.d.ts → graph.d.ts} +1 -1
  38. package/dist/interfaces/{bst.js → graph.js} +1 -1
  39. package/dist/interfaces/graph.js.map +1 -0
  40. package/dist/interfaces/index.d.ts +1 -8
  41. package/dist/interfaces/index.js +1 -8
  42. package/dist/interfaces/index.js.map +1 -1
  43. package/dist/types/data-structures/abstract-graph.d.ts +0 -1
  44. package/dist/types/data-structures/binary-tree.d.ts +30 -2
  45. package/dist/types/data-structures/binary-tree.js +22 -0
  46. package/dist/types/data-structures/binary-tree.js.map +1 -1
  47. package/dist/types/data-structures/bst.d.ts +1 -2
  48. package/dist/types/data-structures/heap.d.ts +2 -1
  49. package/dist/types/data-structures/index.d.ts +0 -2
  50. package/dist/types/data-structures/index.js +0 -2
  51. package/dist/types/data-structures/index.js.map +1 -1
  52. package/lib/data-structures/binary-tree/avl-tree.d.ts +3 -3
  53. package/lib/data-structures/binary-tree/binary-tree.d.ts +8 -8
  54. package/lib/data-structures/binary-tree/binary-tree.js +11 -13
  55. package/lib/data-structures/binary-tree/bst.d.ts +3 -3
  56. package/lib/data-structures/binary-tree/index.d.ts +0 -5
  57. package/lib/data-structures/binary-tree/index.js +0 -5
  58. package/lib/data-structures/binary-tree/rb-tree.d.ts +3 -3
  59. package/lib/data-structures/binary-tree/tree-multiset.d.ts +3 -3
  60. package/lib/data-structures/graph/abstract-graph.d.ts +2 -2
  61. package/lib/data-structures/graph/directed-graph.d.ts +2 -2
  62. package/lib/data-structures/graph/map-graph.d.ts +1 -1
  63. package/lib/data-structures/graph/map-graph.js +1 -1
  64. package/lib/data-structures/graph/undirected-graph.d.ts +2 -2
  65. package/lib/data-structures/hash/index.d.ts +0 -1
  66. package/lib/data-structures/hash/index.js +0 -1
  67. package/lib/data-structures/heap/heap.d.ts +4 -4
  68. package/lib/data-structures/heap/max-heap.d.ts +2 -2
  69. package/lib/data-structures/heap/min-heap.d.ts +2 -2
  70. package/lib/data-structures/priority-queue/max-priority-queue.d.ts +2 -2
  71. package/lib/data-structures/priority-queue/min-priority-queue.d.ts +2 -2
  72. package/lib/data-structures/priority-queue/priority-queue.d.ts +2 -2
  73. package/lib/interfaces/binary-tree.d.ts +5 -4
  74. package/lib/interfaces/{abstract-graph.d.ts → graph.d.ts} +1 -1
  75. package/lib/interfaces/index.d.ts +1 -8
  76. package/lib/interfaces/index.js +1 -8
  77. package/lib/types/data-structures/abstract-graph.d.ts +0 -1
  78. package/lib/types/data-structures/binary-tree.d.ts +30 -2
  79. package/lib/types/data-structures/binary-tree.js +21 -1
  80. package/lib/types/data-structures/bst.d.ts +1 -2
  81. package/lib/types/data-structures/heap.d.ts +2 -1
  82. package/lib/types/data-structures/index.d.ts +0 -2
  83. package/lib/types/data-structures/index.js +0 -2
  84. package/package.json +1 -1
  85. package/src/data-structures/binary-tree/avl-tree.ts +6 -6
  86. package/src/data-structures/binary-tree/binary-tree.ts +29 -39
  87. package/src/data-structures/binary-tree/bst.ts +3 -6
  88. package/src/data-structures/binary-tree/index.ts +0 -5
  89. package/src/data-structures/binary-tree/rb-tree.ts +6 -6
  90. package/src/data-structures/binary-tree/tree-multiset.ts +6 -6
  91. package/src/data-structures/graph/abstract-graph.ts +2 -2
  92. package/src/data-structures/graph/directed-graph.ts +2 -2
  93. package/src/data-structures/graph/map-graph.ts +1 -1
  94. package/src/data-structures/graph/undirected-graph.ts +2 -2
  95. package/src/data-structures/hash/index.ts +0 -1
  96. package/src/data-structures/heap/heap.ts +5 -5
  97. package/src/data-structures/heap/max-heap.ts +2 -2
  98. package/src/data-structures/heap/min-heap.ts +2 -2
  99. package/src/data-structures/priority-queue/max-priority-queue.ts +2 -2
  100. package/src/data-structures/priority-queue/min-priority-queue.ts +2 -2
  101. package/src/data-structures/priority-queue/priority-queue.ts +2 -2
  102. package/src/interfaces/binary-tree.ts +7 -4
  103. package/src/interfaces/{abstract-graph.ts → graph.ts} +1 -1
  104. package/src/interfaces/index.ts +1 -8
  105. package/src/types/data-structures/abstract-graph.ts +1 -1
  106. package/src/types/data-structures/binary-tree.ts +42 -2
  107. package/src/types/data-structures/bst.ts +2 -2
  108. package/src/types/data-structures/heap.ts +3 -1
  109. package/src/types/data-structures/index.ts +0 -2
  110. package/src/types/data-structures/navigator.ts +1 -0
  111. package/test/unit/data-structures/heap/max-heap.test.ts +2 -2
  112. package/test/unit/data-structures/heap/min-heap.test.ts +2 -2
  113. package/umd/bundle.min.js +1 -1
  114. package/umd/bundle.min.js.map +1 -1
  115. package/dist/data-structures/binary-tree/aa-tree.d.ts +0 -2
  116. package/dist/data-structures/binary-tree/aa-tree.js +0 -7
  117. package/dist/data-structures/binary-tree/aa-tree.js.map +0 -1
  118. package/dist/data-structures/binary-tree/abstract-binary-tree.d.ts +0 -21
  119. package/dist/data-structures/binary-tree/abstract-binary-tree.js +0 -25
  120. package/dist/data-structures/binary-tree/abstract-binary-tree.js.map +0 -1
  121. package/dist/data-structures/binary-tree/b-tree.d.ts +0 -2
  122. package/dist/data-structures/binary-tree/b-tree.js +0 -7
  123. package/dist/data-structures/binary-tree/b-tree.js.map +0 -1
  124. package/dist/data-structures/binary-tree/splay-tree.d.ts +0 -2
  125. package/dist/data-structures/binary-tree/splay-tree.js +0 -7
  126. package/dist/data-structures/binary-tree/splay-tree.js.map +0 -1
  127. package/dist/data-structures/binary-tree/two-three-tree.d.ts +0 -2
  128. package/dist/data-structures/binary-tree/two-three-tree.js +0 -7
  129. package/dist/data-structures/binary-tree/two-three-tree.js.map +0 -1
  130. package/dist/data-structures/hash/pair.d.ts +0 -2
  131. package/dist/data-structures/hash/pair.js +0 -7
  132. package/dist/data-structures/hash/pair.js.map +0 -1
  133. package/dist/interfaces/abstract-binary-tree.d.ts +0 -7
  134. package/dist/interfaces/abstract-binary-tree.js +0 -3
  135. package/dist/interfaces/abstract-binary-tree.js.map +0 -1
  136. package/dist/interfaces/abstract-graph.js +0 -3
  137. package/dist/interfaces/abstract-graph.js.map +0 -1
  138. package/dist/interfaces/avl-tree.d.ts +0 -7
  139. package/dist/interfaces/avl-tree.js +0 -3
  140. package/dist/interfaces/avl-tree.js.map +0 -1
  141. package/dist/interfaces/bst.d.ts +0 -6
  142. package/dist/interfaces/bst.js.map +0 -1
  143. package/dist/interfaces/directed-graph.d.ts +0 -3
  144. package/dist/interfaces/directed-graph.js +0 -3
  145. package/dist/interfaces/directed-graph.js.map +0 -1
  146. package/dist/interfaces/rb-tree.d.ts +0 -6
  147. package/dist/interfaces/rb-tree.js +0 -3
  148. package/dist/interfaces/rb-tree.js.map +0 -1
  149. package/dist/interfaces/tree-multiset.d.ts +0 -6
  150. package/dist/interfaces/tree-multiset.js +0 -3
  151. package/dist/interfaces/tree-multiset.js.map +0 -1
  152. package/dist/interfaces/undirected-graph.d.ts +0 -3
  153. package/dist/interfaces/undirected-graph.js +0 -3
  154. package/dist/interfaces/undirected-graph.js.map +0 -1
  155. package/dist/types/data-structures/abstract-binary-tree.d.ts +0 -32
  156. package/dist/types/data-structures/abstract-binary-tree.js +0 -25
  157. package/dist/types/data-structures/abstract-binary-tree.js.map +0 -1
  158. package/dist/types/data-structures/priority-queue.d.ts +0 -7
  159. package/dist/types/data-structures/priority-queue.js +0 -3
  160. package/dist/types/data-structures/priority-queue.js.map +0 -1
  161. package/lib/data-structures/binary-tree/aa-tree.d.ts +0 -2
  162. package/lib/data-structures/binary-tree/aa-tree.js +0 -2
  163. package/lib/data-structures/binary-tree/abstract-binary-tree.d.ts +0 -21
  164. package/lib/data-structures/binary-tree/abstract-binary-tree.js +0 -19
  165. package/lib/data-structures/binary-tree/b-tree.d.ts +0 -2
  166. package/lib/data-structures/binary-tree/b-tree.js +0 -2
  167. package/lib/data-structures/binary-tree/splay-tree.d.ts +0 -2
  168. package/lib/data-structures/binary-tree/splay-tree.js +0 -2
  169. package/lib/data-structures/binary-tree/two-three-tree.d.ts +0 -2
  170. package/lib/data-structures/binary-tree/two-three-tree.js +0 -2
  171. package/lib/data-structures/hash/pair.d.ts +0 -2
  172. package/lib/data-structures/hash/pair.js +0 -2
  173. package/lib/interfaces/abstract-binary-tree.d.ts +0 -7
  174. package/lib/interfaces/abstract-graph.js +0 -1
  175. package/lib/interfaces/avl-tree.d.ts +0 -7
  176. package/lib/interfaces/avl-tree.js +0 -1
  177. package/lib/interfaces/bst.d.ts +0 -6
  178. package/lib/interfaces/bst.js +0 -1
  179. package/lib/interfaces/directed-graph.d.ts +0 -3
  180. package/lib/interfaces/directed-graph.js +0 -1
  181. package/lib/interfaces/rb-tree.d.ts +0 -6
  182. package/lib/interfaces/rb-tree.js +0 -1
  183. package/lib/interfaces/tree-multiset.d.ts +0 -6
  184. package/lib/interfaces/tree-multiset.js +0 -1
  185. package/lib/interfaces/undirected-graph.d.ts +0 -3
  186. package/lib/interfaces/undirected-graph.js +0 -1
  187. package/lib/types/data-structures/abstract-binary-tree.d.ts +0 -32
  188. package/lib/types/data-structures/abstract-binary-tree.js +0 -21
  189. package/lib/types/data-structures/priority-queue.d.ts +0 -7
  190. package/lib/types/data-structures/priority-queue.js +0 -1
  191. package/src/data-structures/binary-tree/aa-tree.ts +0 -1
  192. package/src/data-structures/binary-tree/abstract-binary-tree.ts +0 -33
  193. package/src/data-structures/binary-tree/b-tree.ts +0 -1
  194. package/src/data-structures/binary-tree/splay-tree.ts +0 -1
  195. package/src/data-structures/binary-tree/two-three-tree.ts +0 -1
  196. package/src/data-structures/hash/pair.ts +0 -1
  197. package/src/interfaces/abstract-binary-tree.ts +0 -8
  198. package/src/interfaces/avl-tree.ts +0 -8
  199. package/src/interfaces/bst.ts +0 -6
  200. package/src/interfaces/directed-graph.ts +0 -3
  201. package/src/interfaces/rb-tree.ts +0 -6
  202. package/src/interfaces/tree-multiset.ts +0 -7
  203. package/src/interfaces/undirected-graph.ts +0 -3
  204. package/src/types/data-structures/abstract-binary-tree.ts +0 -49
  205. package/src/types/data-structures/priority-queue.ts +0 -9
  206. /package/lib/interfaces/{abstract-binary-tree.js → graph.js} +0 -0
@@ -1 +0,0 @@
1
- export class TwoThreeTree {}
@@ -1 +0,0 @@
1
- export class Pair {}
@@ -1,8 +0,0 @@
1
- import {BinaryTreeNodeKey} from '../types';
2
- import {AbstractBinaryTreeNode} from '../data-structures';
3
-
4
- export interface IAbstractBinaryTreeNode<T, NEIGHBOR extends IAbstractBinaryTreeNode<T, NEIGHBOR>> {}
5
-
6
- export interface IAbstractBinaryTree<N extends AbstractBinaryTreeNode<N['val'], N>> {
7
- createNode(key: BinaryTreeNodeKey, val?: N['val'], count?: number): N | null;
8
- }
@@ -1,8 +0,0 @@
1
- import {AVLTreeNode} from '../data-structures';
2
- import {IBST, IBSTNode} from './bst';
3
-
4
- export interface IAVLTreeNode<T, NEIGHBOR extends IAVLTreeNode<T, NEIGHBOR>> extends IBSTNode<T, NEIGHBOR> {
5
- height: number;
6
- }
7
-
8
- export interface IAVLTree<N extends AVLTreeNode<N['val'], N>> extends IBST<N> {}
@@ -1,6 +0,0 @@
1
- import {BSTNode} from '../data-structures';
2
- import {IBinaryTree, IBinaryTreeNode} from './binary-tree';
3
-
4
- export interface IBSTNode<T, NEIGHBOR extends IBSTNode<T, NEIGHBOR>> extends IBinaryTreeNode<T, NEIGHBOR> {}
5
-
6
- export interface IBST<N extends BSTNode<N['val'], N>> extends IBinaryTree<N> {}
@@ -1,3 +0,0 @@
1
- import {IAbstractGraph} from './abstract-graph';
2
-
3
- export interface IDirectedGraph<V, E> extends IAbstractGraph<V, E> {}
@@ -1,6 +0,0 @@
1
- import {RBTreeNode} from '../data-structures';
2
- import {IBST, IBSTNode} from './bst';
3
-
4
- export interface IRBTreeNode<T, NEIGHBOR extends IRBTreeNode<T, NEIGHBOR>> extends IBSTNode<T, NEIGHBOR> {}
5
-
6
- export interface IRBTree<N extends RBTreeNode<N['val'], N>> extends IBST<N> {}
@@ -1,7 +0,0 @@
1
- import {TreeMultisetNode} from '../data-structures';
2
- import {IAVLTree, IAVLTreeNode} from './avl-tree';
3
-
4
- export interface ITreeMultisetNode<T, NEIGHBOR extends ITreeMultisetNode<T, NEIGHBOR>>
5
- extends IAVLTreeNode<T, NEIGHBOR> {}
6
-
7
- export interface ITreeMultiset<N extends TreeMultisetNode<N['val'], N>> extends IAVLTree<N> {}
@@ -1,3 +0,0 @@
1
- import {IAbstractGraph} from './abstract-graph';
2
-
3
- export interface IUNDirectedGraph<V, E> extends IAbstractGraph<V, E> {}
@@ -1,49 +0,0 @@
1
- import {AbstractBinaryTreeNode} from '../../data-structures';
2
-
3
- /**
4
- * Enum representing different loop types.
5
- *
6
- * - `iterative`: Indicates the iterative loop type (with loops that use iterations).
7
- * - `recursive`: Indicates the recursive loop type (with loops that call themselves).
8
- */
9
-
10
- export enum LoopType {
11
- ITERATIVE = 'ITERATIVE',
12
- RECURSIVE = 'RECURSIVE'
13
- }
14
-
15
- export enum FamilyPosition {
16
- ROOT = 'ROOT',
17
- LEFT = 'LEFT',
18
- RIGHT = 'RIGHT',
19
- ROOT_LEFT = 'ROOT_LEFT',
20
- ROOT_RIGHT = 'ROOT_RIGHT',
21
- ISOLATED = 'ISOLATED',
22
- MAL_NODE = 'MAL_NODE'
23
- }
24
-
25
- export type BinaryTreeNodePropertyName = 'key' | 'val';
26
-
27
- export type NodeOrPropertyName = 'node' | BinaryTreeNodePropertyName;
28
-
29
- export type DFSOrderPattern = 'in' | 'pre' | 'post';
30
-
31
- export type BinaryTreeNodeKey = number;
32
-
33
- export type BinaryTreeDeletedResult<N> = { deleted: N | null | undefined; needBalanced: N | null };
34
-
35
- export type AbstractBinaryTreeNodeProperty<N extends AbstractBinaryTreeNode<N['val'], N>> =
36
- | N['val']
37
- | N
38
- | number
39
- | BinaryTreeNodeKey;
40
-
41
-
42
- export type AbstractBinaryTreeNodeProperties<N extends AbstractBinaryTreeNode<N['val'], N>> =
43
- AbstractBinaryTreeNodeProperty<N>[];
44
-
45
- 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>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>;
46
-
47
- export type AbstractBinaryTreeOptions = {
48
-
49
- };
@@ -1,9 +0,0 @@
1
- export type PriorityQueueComparator<T> = (a: T, b: T) => number;
2
-
3
- export type PriorityQueueOptions<T> = {
4
- nodes?: T[];
5
- isFix?: boolean;
6
- comparator: PriorityQueueComparator<T>;
7
- };
8
-
9
- export type PriorityQueueDFSOrderPattern = 'pre' | 'in' | 'post';