data-structure-typed 1.51.9 → 1.52.1

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 +1 -1
  2. package/README.md +141 -54
  3. package/benchmark/report.html +37 -1
  4. package/benchmark/report.json +385 -13
  5. package/dist/cjs/data-structures/base/index.d.ts +2 -1
  6. package/dist/cjs/data-structures/base/index.js +2 -1
  7. package/dist/cjs/data-structures/base/index.js.map +1 -1
  8. package/dist/cjs/data-structures/base/iterable-element-base.d.ts +171 -0
  9. package/dist/cjs/data-structures/base/iterable-element-base.js +226 -0
  10. package/dist/cjs/data-structures/base/iterable-element-base.js.map +1 -0
  11. package/dist/cjs/data-structures/base/{iterable-base.d.ts → iterable-entry-base.d.ts} +4 -147
  12. package/dist/cjs/data-structures/base/{iterable-base.js → iterable-entry-base.js} +13 -190
  13. package/dist/cjs/data-structures/base/iterable-entry-base.js.map +1 -0
  14. package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.d.ts +13 -13
  15. package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.js +6 -6
  16. package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.js.map +1 -1
  17. package/dist/cjs/data-structures/binary-tree/avl-tree.d.ts +13 -13
  18. package/dist/cjs/data-structures/binary-tree/avl-tree.js +6 -6
  19. package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -1
  20. package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +99 -99
  21. package/dist/cjs/data-structures/binary-tree/binary-tree.js +54 -52
  22. package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -1
  23. package/dist/cjs/data-structures/binary-tree/bst.d.ts +37 -45
  24. package/dist/cjs/data-structures/binary-tree/bst.js +17 -25
  25. package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -1
  26. package/dist/cjs/data-structures/binary-tree/rb-tree.d.ts +10 -10
  27. package/dist/cjs/data-structures/binary-tree/rb-tree.js +6 -6
  28. package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -1
  29. package/dist/cjs/data-structures/binary-tree/tree-multi-map.d.ts +12 -12
  30. package/dist/cjs/data-structures/binary-tree/tree-multi-map.js +5 -5
  31. package/dist/cjs/data-structures/binary-tree/tree-multi-map.js.map +1 -1
  32. package/dist/cjs/data-structures/graph/directed-graph.js +2 -1
  33. package/dist/cjs/data-structures/graph/directed-graph.js.map +1 -1
  34. package/dist/cjs/data-structures/hash/hash-map.d.ts +2 -2
  35. package/dist/cjs/data-structures/hash/hash-map.js.map +1 -1
  36. package/dist/cjs/data-structures/heap/heap.d.ts +43 -114
  37. package/dist/cjs/data-structures/heap/heap.js +59 -127
  38. package/dist/cjs/data-structures/heap/heap.js.map +1 -1
  39. package/dist/cjs/data-structures/heap/max-heap.d.ts +50 -4
  40. package/dist/cjs/data-structures/heap/max-heap.js +76 -10
  41. package/dist/cjs/data-structures/heap/max-heap.js.map +1 -1
  42. package/dist/cjs/data-structures/heap/min-heap.d.ts +51 -5
  43. package/dist/cjs/data-structures/heap/min-heap.js +68 -11
  44. package/dist/cjs/data-structures/heap/min-heap.js.map +1 -1
  45. package/dist/cjs/data-structures/linked-list/doubly-linked-list.d.ts +22 -28
  46. package/dist/cjs/data-structures/linked-list/doubly-linked-list.js +26 -28
  47. package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +1 -1
  48. package/dist/cjs/data-structures/linked-list/singly-linked-list.d.ts +22 -25
  49. package/dist/cjs/data-structures/linked-list/singly-linked-list.js +29 -26
  50. package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -1
  51. package/dist/cjs/data-structures/priority-queue/max-priority-queue.d.ts +50 -4
  52. package/dist/cjs/data-structures/priority-queue/max-priority-queue.js +79 -10
  53. package/dist/cjs/data-structures/priority-queue/max-priority-queue.js.map +1 -1
  54. package/dist/cjs/data-structures/priority-queue/min-priority-queue.d.ts +51 -5
  55. package/dist/cjs/data-structures/priority-queue/min-priority-queue.js +71 -11
  56. package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +1 -1
  57. package/dist/cjs/data-structures/priority-queue/priority-queue.d.ts +50 -4
  58. package/dist/cjs/data-structures/priority-queue/priority-queue.js +70 -1
  59. package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +1 -1
  60. package/dist/cjs/data-structures/queue/deque.d.ts +27 -18
  61. package/dist/cjs/data-structures/queue/deque.js +43 -21
  62. package/dist/cjs/data-structures/queue/deque.js.map +1 -1
  63. package/dist/cjs/data-structures/queue/queue.d.ts +8 -29
  64. package/dist/cjs/data-structures/queue/queue.js +15 -32
  65. package/dist/cjs/data-structures/queue/queue.js.map +1 -1
  66. package/dist/cjs/data-structures/stack/stack.d.ts +17 -22
  67. package/dist/cjs/data-structures/stack/stack.js +25 -24
  68. package/dist/cjs/data-structures/stack/stack.js.map +1 -1
  69. package/dist/cjs/data-structures/trie/trie.d.ts +18 -13
  70. package/dist/cjs/data-structures/trie/trie.js +26 -15
  71. package/dist/cjs/data-structures/trie/trie.js.map +1 -1
  72. package/dist/cjs/interfaces/binary-tree.d.ts +4 -4
  73. package/dist/cjs/types/common.d.ts +1 -22
  74. package/dist/cjs/types/data-structures/base/base.d.ts +5 -2
  75. package/dist/cjs/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +2 -3
  76. package/dist/cjs/types/data-structures/binary-tree/avl-tree.d.ts +2 -3
  77. package/dist/cjs/types/data-structures/binary-tree/binary-tree.d.ts +20 -4
  78. package/dist/cjs/types/data-structures/binary-tree/bst.d.ts +5 -3
  79. package/dist/cjs/types/data-structures/binary-tree/rb-tree.d.ts +2 -3
  80. package/dist/cjs/types/data-structures/binary-tree/tree-multi-map.d.ts +2 -3
  81. package/dist/cjs/types/data-structures/heap/heap.d.ts +3 -2
  82. package/dist/cjs/types/data-structures/linked-list/doubly-linked-list.d.ts +2 -1
  83. package/dist/cjs/types/data-structures/linked-list/singly-linked-list.d.ts +2 -1
  84. package/dist/cjs/types/data-structures/priority-queue/priority-queue.d.ts +1 -1
  85. package/dist/cjs/types/data-structures/queue/deque.d.ts +4 -2
  86. package/dist/cjs/types/data-structures/queue/queue.d.ts +2 -1
  87. package/dist/cjs/types/data-structures/stack/stack.d.ts +2 -1
  88. package/dist/cjs/types/data-structures/trie/trie.d.ts +3 -2
  89. package/dist/cjs/utils/number.js +1 -2
  90. package/dist/cjs/utils/number.js.map +1 -1
  91. package/dist/cjs/utils/utils.js +2 -2
  92. package/dist/cjs/utils/utils.js.map +1 -1
  93. package/dist/mjs/data-structures/base/index.d.ts +2 -1
  94. package/dist/mjs/data-structures/base/index.js +2 -1
  95. package/dist/mjs/data-structures/base/iterable-element-base.d.ts +171 -0
  96. package/dist/mjs/data-structures/base/iterable-element-base.js +222 -0
  97. package/dist/mjs/data-structures/base/{iterable-base.d.ts → iterable-entry-base.d.ts} +4 -147
  98. package/dist/mjs/data-structures/base/{iterable-base.js → iterable-entry-base.js} +10 -186
  99. package/dist/mjs/data-structures/binary-tree/avl-tree-multi-map.d.ts +13 -13
  100. package/dist/mjs/data-structures/binary-tree/avl-tree-multi-map.js +6 -6
  101. package/dist/mjs/data-structures/binary-tree/avl-tree.d.ts +13 -13
  102. package/dist/mjs/data-structures/binary-tree/avl-tree.js +6 -6
  103. package/dist/mjs/data-structures/binary-tree/binary-tree.d.ts +99 -99
  104. package/dist/mjs/data-structures/binary-tree/binary-tree.js +54 -52
  105. package/dist/mjs/data-structures/binary-tree/bst.d.ts +37 -45
  106. package/dist/mjs/data-structures/binary-tree/bst.js +17 -25
  107. package/dist/mjs/data-structures/binary-tree/rb-tree.d.ts +10 -10
  108. package/dist/mjs/data-structures/binary-tree/rb-tree.js +6 -6
  109. package/dist/mjs/data-structures/binary-tree/tree-multi-map.d.ts +12 -12
  110. package/dist/mjs/data-structures/binary-tree/tree-multi-map.js +5 -5
  111. package/dist/mjs/data-structures/graph/directed-graph.js +2 -1
  112. package/dist/mjs/data-structures/hash/hash-map.d.ts +2 -2
  113. package/dist/mjs/data-structures/heap/heap.d.ts +43 -114
  114. package/dist/mjs/data-structures/heap/heap.js +60 -128
  115. package/dist/mjs/data-structures/heap/max-heap.d.ts +50 -4
  116. package/dist/mjs/data-structures/heap/max-heap.js +79 -10
  117. package/dist/mjs/data-structures/heap/min-heap.d.ts +51 -5
  118. package/dist/mjs/data-structures/heap/min-heap.js +68 -11
  119. package/dist/mjs/data-structures/linked-list/doubly-linked-list.d.ts +22 -28
  120. package/dist/mjs/data-structures/linked-list/doubly-linked-list.js +26 -28
  121. package/dist/mjs/data-structures/linked-list/singly-linked-list.d.ts +22 -25
  122. package/dist/mjs/data-structures/linked-list/singly-linked-list.js +29 -26
  123. package/dist/mjs/data-structures/priority-queue/max-priority-queue.d.ts +50 -4
  124. package/dist/mjs/data-structures/priority-queue/max-priority-queue.js +82 -10
  125. package/dist/mjs/data-structures/priority-queue/min-priority-queue.d.ts +51 -5
  126. package/dist/mjs/data-structures/priority-queue/min-priority-queue.js +71 -11
  127. package/dist/mjs/data-structures/priority-queue/priority-queue.d.ts +50 -4
  128. package/dist/mjs/data-structures/priority-queue/priority-queue.js +70 -1
  129. package/dist/mjs/data-structures/queue/deque.d.ts +27 -18
  130. package/dist/mjs/data-structures/queue/deque.js +43 -21
  131. package/dist/mjs/data-structures/queue/queue.d.ts +8 -29
  132. package/dist/mjs/data-structures/queue/queue.js +15 -32
  133. package/dist/mjs/data-structures/stack/stack.d.ts +17 -22
  134. package/dist/mjs/data-structures/stack/stack.js +25 -24
  135. package/dist/mjs/data-structures/trie/trie.d.ts +18 -13
  136. package/dist/mjs/data-structures/trie/trie.js +26 -15
  137. package/dist/mjs/interfaces/binary-tree.d.ts +4 -4
  138. package/dist/mjs/types/common.d.ts +1 -22
  139. package/dist/mjs/types/data-structures/base/base.d.ts +5 -2
  140. package/dist/mjs/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +2 -3
  141. package/dist/mjs/types/data-structures/binary-tree/avl-tree.d.ts +2 -3
  142. package/dist/mjs/types/data-structures/binary-tree/binary-tree.d.ts +20 -4
  143. package/dist/mjs/types/data-structures/binary-tree/bst.d.ts +5 -3
  144. package/dist/mjs/types/data-structures/binary-tree/rb-tree.d.ts +2 -3
  145. package/dist/mjs/types/data-structures/binary-tree/tree-multi-map.d.ts +2 -3
  146. package/dist/mjs/types/data-structures/heap/heap.d.ts +3 -2
  147. package/dist/mjs/types/data-structures/linked-list/doubly-linked-list.d.ts +2 -1
  148. package/dist/mjs/types/data-structures/linked-list/singly-linked-list.d.ts +2 -1
  149. package/dist/mjs/types/data-structures/priority-queue/priority-queue.d.ts +1 -1
  150. package/dist/mjs/types/data-structures/queue/deque.d.ts +4 -2
  151. package/dist/mjs/types/data-structures/queue/queue.d.ts +2 -1
  152. package/dist/mjs/types/data-structures/stack/stack.d.ts +2 -1
  153. package/dist/mjs/types/data-structures/trie/trie.d.ts +3 -2
  154. package/dist/umd/data-structure-typed.js +732 -409
  155. package/dist/umd/data-structure-typed.min.js +2 -2
  156. package/dist/umd/data-structure-typed.min.js.map +1 -1
  157. package/package.json +7 -7
  158. package/src/data-structures/base/index.ts +2 -1
  159. package/src/data-structures/base/iterable-element-base.ts +250 -0
  160. package/src/data-structures/base/{iterable-base.ts → iterable-entry-base.ts} +22 -213
  161. package/src/data-structures/binary-tree/avl-tree-multi-map.ts +14 -15
  162. package/src/data-structures/binary-tree/avl-tree.ts +13 -14
  163. package/src/data-structures/binary-tree/binary-tree.ts +156 -152
  164. package/src/data-structures/binary-tree/bst.ts +52 -60
  165. package/src/data-structures/binary-tree/rb-tree.ts +12 -13
  166. package/src/data-structures/binary-tree/tree-multi-map.ts +12 -13
  167. package/src/data-structures/graph/directed-graph.ts +2 -1
  168. package/src/data-structures/hash/hash-map.ts +4 -4
  169. package/src/data-structures/heap/heap.ts +71 -152
  170. package/src/data-structures/heap/max-heap.ts +88 -13
  171. package/src/data-structures/heap/min-heap.ts +78 -15
  172. package/src/data-structures/linked-list/doubly-linked-list.ts +32 -32
  173. package/src/data-structures/linked-list/singly-linked-list.ts +37 -29
  174. package/src/data-structures/priority-queue/max-priority-queue.ts +94 -13
  175. package/src/data-structures/priority-queue/min-priority-queue.ts +84 -15
  176. package/src/data-structures/priority-queue/priority-queue.ts +81 -4
  177. package/src/data-structures/queue/deque.ts +50 -25
  178. package/src/data-structures/queue/queue.ts +23 -37
  179. package/src/data-structures/stack/stack.ts +31 -26
  180. package/src/data-structures/trie/trie.ts +33 -18
  181. package/src/interfaces/binary-tree.ts +4 -5
  182. package/src/types/common.ts +2 -24
  183. package/src/types/data-structures/base/base.ts +14 -6
  184. package/src/types/data-structures/binary-tree/avl-tree-multi-map.ts +2 -3
  185. package/src/types/data-structures/binary-tree/avl-tree.ts +2 -3
  186. package/src/types/data-structures/binary-tree/binary-tree.ts +24 -5
  187. package/src/types/data-structures/binary-tree/bst.ts +9 -3
  188. package/src/types/data-structures/binary-tree/rb-tree.ts +2 -3
  189. package/src/types/data-structures/binary-tree/tree-multi-map.ts +2 -3
  190. package/src/types/data-structures/heap/heap.ts +4 -1
  191. package/src/types/data-structures/linked-list/doubly-linked-list.ts +3 -1
  192. package/src/types/data-structures/linked-list/singly-linked-list.ts +3 -1
  193. package/src/types/data-structures/priority-queue/priority-queue.ts +1 -1
  194. package/src/types/data-structures/queue/deque.ts +6 -1
  195. package/src/types/data-structures/queue/queue.ts +3 -1
  196. package/src/types/data-structures/stack/stack.ts +3 -1
  197. package/src/types/data-structures/trie/trie.ts +3 -1
  198. package/test/unit/data-structures/binary-tree/avl-tree-multi-map.test.ts +1 -1
  199. package/test/unit/data-structures/graph/directed-graph.test.ts +28 -0
  200. package/test/unit/data-structures/heap/heap.test.ts +100 -0
  201. package/test/unit/data-structures/heap/max-heap.test.ts +44 -1
  202. package/test/unit/data-structures/heap/min-heap.test.ts +18 -1
  203. package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +42 -0
  204. package/test/unit/data-structures/queue/deque.test.ts +49 -0
  205. package/test/unit/data-structures/queue/queue.test.ts +56 -0
  206. package/dist/cjs/data-structures/base/iterable-base.js.map +0 -1
@@ -0,0 +1,226 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.IterableElementBase = void 0;
4
+ class IterableElementBase {
5
+ /**
6
+ * The protected constructor initializes the options for the IterableElementBase class, including the
7
+ * toElementFn function.
8
+ * @param [options] - An optional object that contains the following properties:
9
+ */
10
+ constructor(options) {
11
+ if (options) {
12
+ const { toElementFn } = options;
13
+ if (typeof toElementFn === 'function')
14
+ this._toElementFn = toElementFn;
15
+ else if (toElementFn)
16
+ throw new TypeError('toElementFn must be a function type');
17
+ }
18
+ }
19
+ /**
20
+ * The function returns the _toElementFn property, which is a function that converts a raw element to
21
+ * a specific type.
22
+ * @returns The function `get toElementFn()` is returning either a function that takes a raw element
23
+ * `rawElement` of type `R` and returns an element `E`, or `undefined` if no function is assigned to
24
+ * `_toElementFn`.
25
+ */
26
+ get toElementFn() {
27
+ return this._toElementFn;
28
+ }
29
+ /**
30
+ * Time Complexity: O(n)
31
+ * Space Complexity: O(1)
32
+ */
33
+ /**
34
+ * Time Complexity: O(n)
35
+ * Space Complexity: O(1)
36
+ *
37
+ * The function is an implementation of the Symbol.iterator method that returns an IterableIterator.
38
+ * @param {any[]} args - The `args` parameter in the code snippet represents a rest parameter. It
39
+ * allows the function to accept any number of arguments as an array. In this case, the `args`
40
+ * parameter is used to pass any number of arguments to the `_getIterator` method.
41
+ */
42
+ *[Symbol.iterator](...args) {
43
+ yield* this._getIterator(...args);
44
+ }
45
+ /**
46
+ * Time Complexity: O(n)
47
+ * Space Complexity: O(n)
48
+ */
49
+ /**
50
+ * Time Complexity: O(n)
51
+ * Space Complexity: O(n)
52
+ *
53
+ * The function returns an iterator that yields all the values in the object.
54
+ */
55
+ *values() {
56
+ for (const item of this) {
57
+ yield item;
58
+ }
59
+ }
60
+ /**
61
+ * Time Complexity: O(n)
62
+ * Space Complexity: O(1)
63
+ */
64
+ /**
65
+ * Time Complexity: O(n)
66
+ * Space Complexity: O(1)
67
+ *
68
+ * The `every` function checks if every element in the array satisfies a given predicate.
69
+ * @param predicate - The `predicate` parameter is a callback function that takes three arguments:
70
+ * the current element being processed, its index, and the array it belongs to. It should return a
71
+ * boolean value indicating whether the element satisfies a certain condition or not.
72
+ * @param {any} [thisArg] - The `thisArg` parameter is an optional argument that specifies the value
73
+ * to be used as `this` when executing the `predicate` function. If `thisArg` is provided, it will be
74
+ * passed as the `this` value to the `predicate` function. If `thisArg` is
75
+ * @returns The `every` method is returning a boolean value. It returns `true` if every element in
76
+ * the array satisfies the provided predicate function, and `false` otherwise.
77
+ */
78
+ every(predicate, thisArg) {
79
+ let index = 0;
80
+ for (const item of this) {
81
+ if (!predicate.call(thisArg, item, index++, this)) {
82
+ return false;
83
+ }
84
+ }
85
+ return true;
86
+ }
87
+ /**
88
+ * Time Complexity: O(n)
89
+ * Space Complexity: O(1)
90
+ */
91
+ /**
92
+ * Time Complexity: O(n)
93
+ * Space Complexity: O(1)
94
+ */
95
+ /**
96
+ * Time Complexity: O(n)
97
+ * Space Complexity: O(1)
98
+ *
99
+ * The "some" function checks if at least one element in a collection satisfies a given predicate.
100
+ * @param predicate - The `predicate` parameter is a callback function that takes three arguments:
101
+ * `value`, `index`, and `array`. It should return a boolean value indicating whether the current
102
+ * element satisfies the condition.
103
+ * @param {any} [thisArg] - The `thisArg` parameter is an optional argument that specifies the value
104
+ * to be used as the `this` value when executing the `predicate` function. If `thisArg` is provided,
105
+ * it will be passed as the `this` value to the `predicate` function. If `thisArg
106
+ * @returns a boolean value. It returns true if the predicate function returns true for any element
107
+ * in the collection, and false otherwise.
108
+ */
109
+ some(predicate, thisArg) {
110
+ let index = 0;
111
+ for (const item of this) {
112
+ if (predicate.call(thisArg, item, index++, this)) {
113
+ return true;
114
+ }
115
+ }
116
+ return false;
117
+ }
118
+ /**
119
+ * Time Complexity: O(n)
120
+ * Space Complexity: O(1)
121
+ */
122
+ /**
123
+ * Time Complexity: O(n)
124
+ * Space Complexity: O(1)
125
+ *
126
+ * The `forEach` function iterates over each element in an array-like object and calls a callback
127
+ * function for each element.
128
+ * @param callbackfn - The callbackfn parameter is a function that will be called for each element in
129
+ * the array. It takes three arguments: the current element being processed, the index of the current
130
+ * element, and the array that forEach was called upon.
131
+ * @param {any} [thisArg] - The `thisArg` parameter is an optional argument that specifies the value
132
+ * to be used as `this` when executing the `callbackfn` function. If `thisArg` is provided, it will
133
+ * be passed as the `this` value to the `callbackfn` function. If `thisArg
134
+ */
135
+ forEach(callbackfn, thisArg) {
136
+ let index = 0;
137
+ for (const item of this) {
138
+ callbackfn.call(thisArg, item, index++, this);
139
+ }
140
+ }
141
+ /**
142
+ * Time Complexity: O(n)
143
+ * Space Complexity: O(1)
144
+ */
145
+ /**
146
+ * Time Complexity: O(n)
147
+ * Space Complexity: O(1)
148
+ *
149
+ * The `find` function iterates over the elements of an array-like object and returns the first
150
+ * element that satisfies the provided callback function.
151
+ * @param callbackfn - The callbackfn parameter is a function that will be called for each element in
152
+ * the array. It takes three arguments: the current element being processed, the index of the current
153
+ * element, and the array itself. The function should return a boolean value indicating whether the
154
+ * current element matches the desired condition.
155
+ * @param {any} [thisArg] - The `thisArg` parameter is an optional argument that specifies the value
156
+ * to be used as `this` when executing the `callbackfn` function. If `thisArg` is provided, it will
157
+ * be passed as the `this` value to the `callbackfn` function. If `thisArg
158
+ * @returns The `find` method returns the first element in the array that satisfies the provided
159
+ * callback function. If no element satisfies the callback function, `undefined` is returned.
160
+ */
161
+ find(callbackfn, thisArg) {
162
+ let index = 0;
163
+ for (const item of this) {
164
+ if (callbackfn.call(thisArg, item, index++, this))
165
+ return item;
166
+ }
167
+ return;
168
+ }
169
+ /**
170
+ * Time Complexity: O(n)
171
+ * Space Complexity: O(1)
172
+ *
173
+ * The function checks if a given element exists in a collection.
174
+ * @param {E} element - The parameter "element" is of type E, which means it can be any type. It
175
+ * represents the element that we want to check for existence in the collection.
176
+ * @returns a boolean value. It returns true if the element is found in the collection, and false
177
+ * otherwise.
178
+ */
179
+ has(element) {
180
+ for (const ele of this) {
181
+ if (ele === element)
182
+ return true;
183
+ }
184
+ return false;
185
+ }
186
+ /**
187
+ * Time Complexity: O(n)
188
+ * Space Complexity: O(1)
189
+ */
190
+ /**
191
+ * Time Complexity: O(n)
192
+ * Space Complexity: O(1)
193
+ *
194
+ * The `reduce` function iterates over the elements of an array-like object and applies a callback
195
+ * function to reduce them into a single value.
196
+ * @param callbackfn - The callbackfn parameter is a function that will be called for each element in
197
+ * the array. It takes four arguments:
198
+ * @param {U} initialValue - The initialValue parameter is the initial value of the accumulator. It
199
+ * is the value that the accumulator starts with before the reduction operation begins.
200
+ * @returns The `reduce` method is returning the final value of the accumulator after iterating over
201
+ * all the elements in the array and applying the callback function to each element.
202
+ */
203
+ reduce(callbackfn, initialValue) {
204
+ let accumulator = initialValue;
205
+ let index = 0;
206
+ for (const item of this) {
207
+ accumulator = callbackfn(accumulator, item, index++, this);
208
+ }
209
+ return accumulator;
210
+ }
211
+ /**
212
+ * Time Complexity: O(n)
213
+ * Space Complexity: O(n)
214
+ */
215
+ /**
216
+ * Time Complexity: O(n)
217
+ * Space Complexity: O(n)
218
+ *
219
+ * The print function logs the elements of an array to the console.
220
+ */
221
+ print() {
222
+ console.log([...this]);
223
+ }
224
+ }
225
+ exports.IterableElementBase = IterableElementBase;
226
+ //# sourceMappingURL=iterable-element-base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iterable-element-base.js","sourceRoot":"","sources":["../../../../src/data-structures/base/iterable-element-base.ts"],"names":[],"mappings":";;;AAEA,MAAsB,mBAAmB;IACvC;;;;OAIG;IACH,YAAsB,OAA0C;QAC9D,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;YAChC,IAAI,OAAO,WAAW,KAAK,UAAU;gBAAE,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;iBAClE,IAAI,WAAW;gBAAE,MAAM,IAAI,SAAS,CAA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'../../types';
1
+ import { EntryCallback, ReduceEntryCallback } from '../../types';
2
2
  export declare abstract class IterableEntryBase<K = any, V = any> {
3
3
  /**
4
4
  * Time Complexity: O(n)
@@ -193,34 +193,6 @@ export declare abstract class IterableEntryBase<K = any, V = any> {
193
193
  * all the elements in the collection.
194
194
  */
195
195
  reduce<U>(callbackfn: ReduceEntryCallback<K, V, U>, initialValue: U): U;
196
- /**
197
- * Time Complexity: O(n)
198
- * Space Complexity: O(n)
199
- */
200
- print(): void;
201
- abstract isEmpty(): boolean;
202
- abstract clear(): void;
203
- abstract clone(): any;
204
- abstract map(...args: any[]): any;
205
- abstract filter(...args: any[]): any;
206
- protected abstract _getIterator(...args: any[]): IterableIterator<[K, V]>;
207
- }
208
- export declare abstract class IterableElementBase<E = any, C = any> {
209
- abstract get size(): number;
210
- /**
211
- * Time Complexity: O(n)
212
- * Space Complexity: O(1)
213
- */
214
- /**
215
- * Time Complexity: O(n)
216
- * Space Complexity: O(1)
217
- *
218
- * The function is an implementation of the Symbol.iterator method that returns an IterableIterator.
219
- * @param {any[]} args - The `args` parameter in the code snippet represents a rest parameter. It
220
- * allows the function to accept any number of arguments as an array. In this case, the `args`
221
- * parameter is used to pass any number of arguments to the `_getIterator` method.
222
- */
223
- [Symbol.iterator](...args: any[]): IterableIterator<E>;
224
196
  /**
225
197
  * Time Complexity: O(n)
226
198
  * Space Complexity: O(n)
@@ -229,128 +201,13 @@ export declare abstract class IterableElementBase<E = any, C = any> {
229
201
  * Time Complexity: O(n)
230
202
  * Space Complexity: O(n)
231
203
  *
232
- * The function returns an iterator that yields all the values in the object.
233
- */
234
- values(): IterableIterator<E>;
235
- /**
236
- * Time Complexity: O(n)
237
- * Space Complexity: O(1)
238
- */
239
- /**
240
- * Time Complexity: O(n)
241
- * Space Complexity: O(1)
242
- *
243
- * The `every` function checks if every element in the array satisfies a given predicate.
244
- * @param predicate - The `predicate` parameter is a callback function that takes three arguments:
245
- * the current element being processed, its index, and the array it belongs to. It should return a
246
- * boolean value indicating whether the element satisfies a certain condition or not.
247
- * @param {any} [thisArg] - The `thisArg` parameter is an optional argument that specifies the value
248
- * to be used as `this` when executing the `predicate` function. If `thisArg` is provided, it will be
249
- * passed as the `this` value to the `predicate` function. If `thisArg` is
250
- * @returns The `every` method is returning a boolean value. It returns `true` if every element in
251
- * the array satisfies the provided predicate function, and `false` otherwise.
252
- */
253
- every(predicate: ElementCallback<E, boolean>, thisArg?: any): boolean;
254
- /**
255
- * Time Complexity: O(n)
256
- * Space Complexity: O(1)
257
- */
258
- /**
259
- * Time Complexity: O(n)
260
- * Space Complexity: O(1)
261
- */
262
- /**
263
- * Time Complexity: O(n)
264
- * Space Complexity: O(1)
265
- *
266
- * The "some" function checks if at least one element in a collection satisfies a given predicate.
267
- * @param predicate - The `predicate` parameter is a callback function that takes three arguments:
268
- * `value`, `index`, and `array`. It should return a boolean value indicating whether the current
269
- * element satisfies the condition.
270
- * @param {any} [thisArg] - The `thisArg` parameter is an optional argument that specifies the value
271
- * to be used as the `this` value when executing the `predicate` function. If `thisArg` is provided,
272
- * it will be passed as the `this` value to the `predicate` function. If `thisArg
273
- * @returns a boolean value. It returns true if the predicate function returns true for any element
274
- * in the collection, and false otherwise.
275
- */
276
- some(predicate: ElementCallback<E, boolean>, thisArg?: any): boolean;
277
- /**
278
- * Time Complexity: O(n)
279
- * Space Complexity: O(1)
280
- */
281
- /**
282
- * Time Complexity: O(n)
283
- * Space Complexity: O(1)
284
- *
285
- * The `forEach` function iterates over each element in an array-like object and calls a callback
286
- * function for each element.
287
- * @param callbackfn - The callbackfn parameter is a function that will be called for each element in
288
- * the array. It takes three arguments: the current element being processed, the index of the current
289
- * element, and the array that forEach was called upon.
290
- * @param {any} [thisArg] - The `thisArg` parameter is an optional argument that specifies the value
291
- * to be used as `this` when executing the `callbackfn` function. If `thisArg` is provided, it will
292
- * be passed as the `this` value to the `callbackfn` function. If `thisArg
293
- */
294
- forEach(callbackfn: ElementCallback<E, void>, thisArg?: any): void;
295
- /**
296
- * Time Complexity: O(n)
297
- * Space Complexity: O(1)
298
- */
299
- /**
300
- * Time Complexity: O(n)
301
- * Space Complexity: O(1)
302
- *
303
- * The `find` function iterates over the elements of an array-like object and returns the first
304
- * element that satisfies the provided callback function.
305
- * @param callbackfn - The callbackfn parameter is a function that will be called for each element in
306
- * the array. It takes three arguments: the current element being processed, the index of the current
307
- * element, and the array itself. The function should return a boolean value indicating whether the
308
- * current element matches the desired condition.
309
- * @param {any} [thisArg] - The `thisArg` parameter is an optional argument that specifies the value
310
- * to be used as `this` when executing the `callbackfn` function. If `thisArg` is provided, it will
311
- * be passed as the `this` value to the `callbackfn` function. If `thisArg
312
- * @returns The `find` method returns the first element in the array that satisfies the provided
313
- * callback function. If no element satisfies the callback function, `undefined` is returned.
314
- */
315
- find(callbackfn: ElementCallback<E, boolean>, thisArg?: any): E | undefined;
316
- /**
317
- * Time Complexity: O(n)
318
- * Space Complexity: O(1)
319
- *
320
- * The function checks if a given element exists in a collection.
321
- * @param {E} element - The parameter "element" is of type E, which means it can be any type. It
322
- * represents the element that we want to check for existence in the collection.
323
- * @returns a boolean value. It returns true if the element is found in the collection, and false
324
- * otherwise.
325
- */
326
- has(element: E): boolean;
327
- /**
328
- * Time Complexity: O(n)
329
- * Space Complexity: O(1)
330
- */
331
- /**
332
- * Time Complexity: O(n)
333
- * Space Complexity: O(1)
334
- *
335
- * The `reduce` function iterates over the elements of an array-like object and applies a callback
336
- * function to reduce them into a single value.
337
- * @param callbackfn - The callbackfn parameter is a function that will be called for each element in
338
- * the array. It takes four arguments:
339
- * @param {U} initialValue - The initialValue parameter is the initial value of the accumulator. It
340
- * is the value that the accumulator starts with before the reduction operation begins.
341
- * @returns The `reduce` method is returning the final value of the accumulator after iterating over
342
- * all the elements in the array and applying the callback function to each element.
343
- */
344
- reduce<U>(callbackfn: ReduceElementCallback<E, U>, initialValue: U): U;
345
- /**
346
- * Time Complexity: O(n)
347
- * Space Complexity: O(n)
204
+ * The print function logs the elements of an array to the console.
348
205
  */
349
206
  print(): void;
350
207
  abstract isEmpty(): boolean;
351
208
  abstract clear(): void;
352
- abstract clone(): C;
209
+ abstract clone(): any;
353
210
  abstract map(...args: any[]): any;
354
211
  abstract filter(...args: any[]): any;
355
- protected abstract _getIterator(...args: any[]): IterableIterator<E>;
212
+ protected abstract _getIterator(...args: any[]): IterableIterator<[K, V]>;
356
213
  }
@@ -1,7 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IterableElementBase = exports.IterableEntryBase = void 0;
3
+ exports.IterableEntryBase = void 0;
4
4
  class IterableEntryBase {
5
+ // protected _toEntryFn?: (rawElement: R) => BTNEntry<K, V>;
6
+ //
7
+ // /**
8
+ // * The function returns the value of the _toEntryFn property.
9
+ // * @returns The function being returned is `this._toEntryFn`.
10
+ // */
11
+ // get toEntryFn() {
12
+ // return this._toEntryFn;
13
+ // }
5
14
  /**
6
15
  * Time Complexity: O(n)
7
16
  * Space Complexity: O(1)
@@ -262,32 +271,6 @@ class IterableEntryBase {
262
271
  }
263
272
  return accumulator;
264
273
  }
265
- /**
266
- * Time Complexity: O(n)
267
- * Space Complexity: O(n)
268
- */
269
- print() {
270
- console.log([...this]);
271
- }
272
- }
273
- exports.IterableEntryBase = IterableEntryBase;
274
- class IterableElementBase {
275
- /**
276
- * Time Complexity: O(n)
277
- * Space Complexity: O(1)
278
- */
279
- /**
280
- * Time Complexity: O(n)
281
- * Space Complexity: O(1)
282
- *
283
- * The function is an implementation of the Symbol.iterator method that returns an IterableIterator.
284
- * @param {any[]} args - The `args` parameter in the code snippet represents a rest parameter. It
285
- * allows the function to accept any number of arguments as an array. In this case, the `args`
286
- * parameter is used to pass any number of arguments to the `_getIterator` method.
287
- */
288
- *[Symbol.iterator](...args) {
289
- yield* this._getIterator(...args);
290
- }
291
274
  /**
292
275
  * Time Complexity: O(n)
293
276
  * Space Complexity: O(n)
@@ -296,171 +279,11 @@ class IterableElementBase {
296
279
  * Time Complexity: O(n)
297
280
  * Space Complexity: O(n)
298
281
  *
299
- * The function returns an iterator that yields all the values in the object.
300
- */
301
- *values() {
302
- for (const item of this) {
303
- yield item;
304
- }
305
- }
306
- /**
307
- * Time Complexity: O(n)
308
- * Space Complexity: O(1)
309
- */
310
- /**
311
- * Time Complexity: O(n)
312
- * Space Complexity: O(1)
313
- *
314
- * The `every` function checks if every element in the array satisfies a given predicate.
315
- * @param predicate - The `predicate` parameter is a callback function that takes three arguments:
316
- * the current element being processed, its index, and the array it belongs to. It should return a
317
- * boolean value indicating whether the element satisfies a certain condition or not.
318
- * @param {any} [thisArg] - The `thisArg` parameter is an optional argument that specifies the value
319
- * to be used as `this` when executing the `predicate` function. If `thisArg` is provided, it will be
320
- * passed as the `this` value to the `predicate` function. If `thisArg` is
321
- * @returns The `every` method is returning a boolean value. It returns `true` if every element in
322
- * the array satisfies the provided predicate function, and `false` otherwise.
323
- */
324
- every(predicate, thisArg) {
325
- let index = 0;
326
- for (const item of this) {
327
- if (!predicate.call(thisArg, item, index++, this)) {
328
- return false;
329
- }
330
- }
331
- return true;
332
- }
333
- /**
334
- * Time Complexity: O(n)
335
- * Space Complexity: O(1)
336
- */
337
- /**
338
- * Time Complexity: O(n)
339
- * Space Complexity: O(1)
340
- */
341
- /**
342
- * Time Complexity: O(n)
343
- * Space Complexity: O(1)
344
- *
345
- * The "some" function checks if at least one element in a collection satisfies a given predicate.
346
- * @param predicate - The `predicate` parameter is a callback function that takes three arguments:
347
- * `value`, `index`, and `array`. It should return a boolean value indicating whether the current
348
- * element satisfies the condition.
349
- * @param {any} [thisArg] - The `thisArg` parameter is an optional argument that specifies the value
350
- * to be used as the `this` value when executing the `predicate` function. If `thisArg` is provided,
351
- * it will be passed as the `this` value to the `predicate` function. If `thisArg
352
- * @returns a boolean value. It returns true if the predicate function returns true for any element
353
- * in the collection, and false otherwise.
354
- */
355
- some(predicate, thisArg) {
356
- let index = 0;
357
- for (const item of this) {
358
- if (predicate.call(thisArg, item, index++, this)) {
359
- return true;
360
- }
361
- }
362
- return false;
363
- }
364
- /**
365
- * Time Complexity: O(n)
366
- * Space Complexity: O(1)
367
- */
368
- /**
369
- * Time Complexity: O(n)
370
- * Space Complexity: O(1)
371
- *
372
- * The `forEach` function iterates over each element in an array-like object and calls a callback
373
- * function for each element.
374
- * @param callbackfn - The callbackfn parameter is a function that will be called for each element in
375
- * the array. It takes three arguments: the current element being processed, the index of the current
376
- * element, and the array that forEach was called upon.
377
- * @param {any} [thisArg] - The `thisArg` parameter is an optional argument that specifies the value
378
- * to be used as `this` when executing the `callbackfn` function. If `thisArg` is provided, it will
379
- * be passed as the `this` value to the `callbackfn` function. If `thisArg
380
- */
381
- forEach(callbackfn, thisArg) {
382
- let index = 0;
383
- for (const item of this) {
384
- callbackfn.call(thisArg, item, index++, this);
385
- }
386
- }
387
- /**
388
- * Time Complexity: O(n)
389
- * Space Complexity: O(1)
390
- */
391
- /**
392
- * Time Complexity: O(n)
393
- * Space Complexity: O(1)
394
- *
395
- * The `find` function iterates over the elements of an array-like object and returns the first
396
- * element that satisfies the provided callback function.
397
- * @param callbackfn - The callbackfn parameter is a function that will be called for each element in
398
- * the array. It takes three arguments: the current element being processed, the index of the current
399
- * element, and the array itself. The function should return a boolean value indicating whether the
400
- * current element matches the desired condition.
401
- * @param {any} [thisArg] - The `thisArg` parameter is an optional argument that specifies the value
402
- * to be used as `this` when executing the `callbackfn` function. If `thisArg` is provided, it will
403
- * be passed as the `this` value to the `callbackfn` function. If `thisArg
404
- * @returns The `find` method returns the first element in the array that satisfies the provided
405
- * callback function. If no element satisfies the callback function, `undefined` is returned.
406
- */
407
- find(callbackfn, thisArg) {
408
- let index = 0;
409
- for (const item of this) {
410
- if (callbackfn.call(thisArg, item, index++, this))
411
- return item;
412
- }
413
- return;
414
- }
415
- /**
416
- * Time Complexity: O(n)
417
- * Space Complexity: O(1)
418
- *
419
- * The function checks if a given element exists in a collection.
420
- * @param {E} element - The parameter "element" is of type E, which means it can be any type. It
421
- * represents the element that we want to check for existence in the collection.
422
- * @returns a boolean value. It returns true if the element is found in the collection, and false
423
- * otherwise.
424
- */
425
- has(element) {
426
- for (const ele of this) {
427
- if (ele === element)
428
- return true;
429
- }
430
- return false;
431
- }
432
- /**
433
- * Time Complexity: O(n)
434
- * Space Complexity: O(1)
435
- */
436
- /**
437
- * Time Complexity: O(n)
438
- * Space Complexity: O(1)
439
- *
440
- * The `reduce` function iterates over the elements of an array-like object and applies a callback
441
- * function to reduce them into a single value.
442
- * @param callbackfn - The callbackfn parameter is a function that will be called for each element in
443
- * the array. It takes four arguments:
444
- * @param {U} initialValue - The initialValue parameter is the initial value of the accumulator. It
445
- * is the value that the accumulator starts with before the reduction operation begins.
446
- * @returns The `reduce` method is returning the final value of the accumulator after iterating over
447
- * all the elements in the array and applying the callback function to each element.
448
- */
449
- reduce(callbackfn, initialValue) {
450
- let accumulator = initialValue;
451
- let index = 0;
452
- for (const item of this) {
453
- accumulator = callbackfn(accumulator, item, index++, this);
454
- }
455
- return accumulator;
456
- }
457
- /**
458
- * Time Complexity: O(n)
459
- * Space Complexity: O(n)
282
+ * The print function logs the elements of an array to the console.
460
283
  */
461
284
  print() {
462
285
  console.log([...this]);
463
286
  }
464
287
  }
465
- exports.IterableElementBase = IterableElementBase;
466
- //# sourceMappingURL=iterable-base.js.map
288
+ exports.IterableEntryBase = IterableEntryBase;
289
+ //# sourceMappingURL=iterable-entry-base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iterable-entry-base.js","sourceRoot":"","sources":["../../../../src/data-structures/base/iterable-entry-base.ts"],"names":[],"mappings":";;;AAEA,MAAsB,iBAAiB;IAgBrC,4DAA4D;IAC5D,EAAE;IACF,MAAM;IACN,gEAAgE;IAChE,gEAAgE;IAChE,MAAM;IACN,oBAAoB;IACpB,4BAA4B;IAC5B,IAAI;IAEJ;;;;;;;;OAQG;IACH,CAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,GAAG,IAAW;QAChC,KAAK,CAA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