data-structure-typed 2.0.5 → 2.1.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/CHANGELOG.md +1 -1
- package/COMMANDS.md +17 -0
- package/benchmark/report.html +13 -77
- package/benchmark/report.json +145 -177
- package/dist/cjs/data-structures/base/iterable-element-base.d.ts +186 -83
- package/dist/cjs/data-structures/base/iterable-element-base.js +149 -107
- package/dist/cjs/data-structures/base/iterable-element-base.js.map +1 -1
- package/dist/cjs/data-structures/base/iterable-entry-base.d.ts +95 -119
- package/dist/cjs/data-structures/base/iterable-entry-base.js +59 -116
- package/dist/cjs/data-structures/base/iterable-entry-base.js.map +1 -1
- package/dist/cjs/data-structures/base/linear-base.d.ts +250 -192
- package/dist/cjs/data-structures/base/linear-base.js +137 -274
- package/dist/cjs/data-structures/base/linear-base.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/avl-tree-counter.d.ts +126 -158
- package/dist/cjs/data-structures/binary-tree/avl-tree-counter.js +171 -205
- package/dist/cjs/data-structures/binary-tree/avl-tree-counter.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.d.ts +100 -69
- package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.js +135 -87
- package/dist/cjs/data-structures/binary-tree/avl-tree-multi-map.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/avl-tree.d.ts +138 -149
- package/dist/cjs/data-structures/binary-tree/avl-tree.js +208 -195
- package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +476 -632
- package/dist/cjs/data-structures/binary-tree/binary-tree.js +594 -865
- package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/bst.d.ts +258 -306
- package/dist/cjs/data-structures/binary-tree/bst.js +505 -481
- package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/red-black-tree.d.ts +107 -179
- package/dist/cjs/data-structures/binary-tree/red-black-tree.js +114 -209
- package/dist/cjs/data-structures/binary-tree/red-black-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/tree-counter.d.ts +132 -154
- package/dist/cjs/data-structures/binary-tree/tree-counter.js +172 -203
- package/dist/cjs/data-structures/binary-tree/tree-counter.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/tree-multi-map.d.ts +72 -69
- package/dist/cjs/data-structures/binary-tree/tree-multi-map.js +105 -85
- package/dist/cjs/data-structures/binary-tree/tree-multi-map.js.map +1 -1
- package/dist/cjs/data-structures/graph/abstract-graph.d.ts +238 -233
- package/dist/cjs/data-structures/graph/abstract-graph.js +267 -237
- package/dist/cjs/data-structures/graph/abstract-graph.js.map +1 -1
- package/dist/cjs/data-structures/graph/directed-graph.d.ts +108 -224
- package/dist/cjs/data-structures/graph/directed-graph.js +146 -233
- package/dist/cjs/data-structures/graph/directed-graph.js.map +1 -1
- package/dist/cjs/data-structures/graph/map-graph.d.ts +49 -55
- package/dist/cjs/data-structures/graph/map-graph.js +56 -59
- package/dist/cjs/data-structures/graph/map-graph.js.map +1 -1
- package/dist/cjs/data-structures/graph/undirected-graph.d.ts +103 -146
- package/dist/cjs/data-structures/graph/undirected-graph.js +129 -149
- package/dist/cjs/data-structures/graph/undirected-graph.js.map +1 -1
- package/dist/cjs/data-structures/hash/hash-map.d.ts +164 -338
- package/dist/cjs/data-structures/hash/hash-map.js +270 -457
- package/dist/cjs/data-structures/hash/hash-map.js.map +1 -1
- package/dist/cjs/data-structures/heap/heap.d.ts +214 -289
- package/dist/cjs/data-structures/heap/heap.js +340 -349
- package/dist/cjs/data-structures/heap/heap.js.map +1 -1
- package/dist/cjs/data-structures/heap/max-heap.d.ts +11 -47
- package/dist/cjs/data-structures/heap/max-heap.js +11 -66
- package/dist/cjs/data-structures/heap/max-heap.js.map +1 -1
- package/dist/cjs/data-structures/heap/min-heap.d.ts +12 -47
- package/dist/cjs/data-structures/heap/min-heap.js +11 -66
- package/dist/cjs/data-structures/heap/min-heap.js.map +1 -1
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.d.ts +231 -347
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js +368 -494
- 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 +261 -310
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js +447 -466
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -1
- package/dist/cjs/data-structures/linked-list/skip-linked-list.d.ts +0 -107
- package/dist/cjs/data-structures/linked-list/skip-linked-list.js +0 -100
- package/dist/cjs/data-structures/linked-list/skip-linked-list.js.map +1 -1
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.d.ts +12 -56
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.js +11 -78
- 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 +11 -57
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.js +10 -79
- 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 -61
- package/dist/cjs/data-structures/priority-queue/priority-queue.js +8 -83
- package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +1 -1
- package/dist/cjs/data-structures/queue/deque.d.ts +227 -254
- package/dist/cjs/data-structures/queue/deque.js +309 -348
- package/dist/cjs/data-structures/queue/deque.js.map +1 -1
- package/dist/cjs/data-structures/queue/queue.d.ts +180 -201
- package/dist/cjs/data-structures/queue/queue.js +265 -248
- package/dist/cjs/data-structures/queue/queue.js.map +1 -1
- package/dist/cjs/data-structures/stack/stack.d.ts +124 -102
- package/dist/cjs/data-structures/stack/stack.js +181 -125
- package/dist/cjs/data-structures/stack/stack.js.map +1 -1
- package/dist/cjs/data-structures/trie/trie.d.ts +164 -165
- package/dist/cjs/data-structures/trie/trie.js +189 -172
- package/dist/cjs/data-structures/trie/trie.js.map +1 -1
- package/dist/cjs/interfaces/binary-tree.d.ts +56 -6
- package/dist/cjs/interfaces/graph.d.ts +16 -0
- package/dist/cjs/types/data-structures/base/base.d.ts +1 -1
- package/dist/cjs/types/data-structures/graph/abstract-graph.d.ts +4 -0
- package/dist/cjs/types/utils/utils.d.ts +1 -0
- package/dist/cjs/utils/utils.d.ts +1 -1
- package/dist/cjs/utils/utils.js +2 -1
- package/dist/cjs/utils/utils.js.map +1 -1
- package/dist/esm/data-structures/base/iterable-element-base.d.ts +186 -83
- package/dist/esm/data-structures/base/iterable-element-base.js +155 -107
- package/dist/esm/data-structures/base/iterable-element-base.js.map +1 -1
- package/dist/esm/data-structures/base/iterable-entry-base.d.ts +95 -119
- package/dist/esm/data-structures/base/iterable-entry-base.js +59 -116
- package/dist/esm/data-structures/base/iterable-entry-base.js.map +1 -1
- package/dist/esm/data-structures/base/linear-base.d.ts +250 -192
- package/dist/esm/data-structures/base/linear-base.js +137 -274
- package/dist/esm/data-structures/base/linear-base.js.map +1 -1
- package/dist/esm/data-structures/binary-tree/avl-tree-counter.d.ts +126 -158
- package/dist/esm/data-structures/binary-tree/avl-tree-counter.js +171 -212
- package/dist/esm/data-structures/binary-tree/avl-tree-counter.js.map +1 -1
- package/dist/esm/data-structures/binary-tree/avl-tree-multi-map.d.ts +100 -69
- package/dist/esm/data-structures/binary-tree/avl-tree-multi-map.js +133 -94
- package/dist/esm/data-structures/binary-tree/avl-tree-multi-map.js.map +1 -1
- package/dist/esm/data-structures/binary-tree/avl-tree.d.ts +138 -149
- package/dist/esm/data-structures/binary-tree/avl-tree.js +206 -200
- package/dist/esm/data-structures/binary-tree/avl-tree.js.map +1 -1
- package/dist/esm/data-structures/binary-tree/binary-tree.d.ts +476 -632
- package/dist/esm/data-structures/binary-tree/binary-tree.js +598 -874
- package/dist/esm/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/esm/data-structures/binary-tree/bst.d.ts +258 -306
- package/dist/esm/data-structures/binary-tree/bst.js +507 -487
- package/dist/esm/data-structures/binary-tree/bst.js.map +1 -1
- package/dist/esm/data-structures/binary-tree/red-black-tree.d.ts +107 -179
- package/dist/esm/data-structures/binary-tree/red-black-tree.js +114 -215
- package/dist/esm/data-structures/binary-tree/red-black-tree.js.map +1 -1
- package/dist/esm/data-structures/binary-tree/tree-counter.d.ts +132 -154
- package/dist/esm/data-structures/binary-tree/tree-counter.js +175 -209
- package/dist/esm/data-structures/binary-tree/tree-counter.js.map +1 -1
- package/dist/esm/data-structures/binary-tree/tree-multi-map.d.ts +72 -69
- package/dist/esm/data-structures/binary-tree/tree-multi-map.js +103 -92
- package/dist/esm/data-structures/binary-tree/tree-multi-map.js.map +1 -1
- package/dist/esm/data-structures/graph/abstract-graph.d.ts +238 -233
- package/dist/esm/data-structures/graph/abstract-graph.js +267 -237
- package/dist/esm/data-structures/graph/abstract-graph.js.map +1 -1
- package/dist/esm/data-structures/graph/directed-graph.d.ts +108 -224
- package/dist/esm/data-structures/graph/directed-graph.js +145 -233
- package/dist/esm/data-structures/graph/directed-graph.js.map +1 -1
- package/dist/esm/data-structures/graph/map-graph.d.ts +49 -55
- package/dist/esm/data-structures/graph/map-graph.js +56 -59
- package/dist/esm/data-structures/graph/map-graph.js.map +1 -1
- package/dist/esm/data-structures/graph/undirected-graph.d.ts +103 -146
- package/dist/esm/data-structures/graph/undirected-graph.js +128 -149
- package/dist/esm/data-structures/graph/undirected-graph.js.map +1 -1
- package/dist/esm/data-structures/hash/hash-map.d.ts +164 -338
- package/dist/esm/data-structures/hash/hash-map.js +270 -457
- package/dist/esm/data-structures/hash/hash-map.js.map +1 -1
- package/dist/esm/data-structures/heap/heap.d.ts +214 -289
- package/dist/esm/data-structures/heap/heap.js +329 -349
- package/dist/esm/data-structures/heap/heap.js.map +1 -1
- package/dist/esm/data-structures/heap/max-heap.d.ts +11 -47
- package/dist/esm/data-structures/heap/max-heap.js +11 -66
- package/dist/esm/data-structures/heap/max-heap.js.map +1 -1
- package/dist/esm/data-structures/heap/min-heap.d.ts +12 -47
- package/dist/esm/data-structures/heap/min-heap.js +11 -66
- package/dist/esm/data-structures/heap/min-heap.js.map +1 -1
- package/dist/esm/data-structures/linked-list/doubly-linked-list.d.ts +231 -347
- package/dist/esm/data-structures/linked-list/doubly-linked-list.js +368 -495
- package/dist/esm/data-structures/linked-list/doubly-linked-list.js.map +1 -1
- package/dist/esm/data-structures/linked-list/singly-linked-list.d.ts +261 -310
- package/dist/esm/data-structures/linked-list/singly-linked-list.js +448 -467
- package/dist/esm/data-structures/linked-list/singly-linked-list.js.map +1 -1
- package/dist/esm/data-structures/linked-list/skip-linked-list.d.ts +0 -107
- package/dist/esm/data-structures/linked-list/skip-linked-list.js +0 -100
- package/dist/esm/data-structures/linked-list/skip-linked-list.js.map +1 -1
- package/dist/esm/data-structures/priority-queue/max-priority-queue.d.ts +12 -56
- package/dist/esm/data-structures/priority-queue/max-priority-queue.js +11 -78
- package/dist/esm/data-structures/priority-queue/max-priority-queue.js.map +1 -1
- package/dist/esm/data-structures/priority-queue/min-priority-queue.d.ts +11 -57
- package/dist/esm/data-structures/priority-queue/min-priority-queue.js +10 -79
- package/dist/esm/data-structures/priority-queue/min-priority-queue.js.map +1 -1
- package/dist/esm/data-structures/priority-queue/priority-queue.d.ts +2 -61
- package/dist/esm/data-structures/priority-queue/priority-queue.js +8 -83
- package/dist/esm/data-structures/priority-queue/priority-queue.js.map +1 -1
- package/dist/esm/data-structures/queue/deque.d.ts +227 -254
- package/dist/esm/data-structures/queue/deque.js +313 -348
- package/dist/esm/data-structures/queue/deque.js.map +1 -1
- package/dist/esm/data-structures/queue/queue.d.ts +180 -201
- package/dist/esm/data-structures/queue/queue.js +263 -248
- package/dist/esm/data-structures/queue/queue.js.map +1 -1
- package/dist/esm/data-structures/stack/stack.d.ts +124 -102
- package/dist/esm/data-structures/stack/stack.js +181 -125
- package/dist/esm/data-structures/stack/stack.js.map +1 -1
- package/dist/esm/data-structures/trie/trie.d.ts +164 -165
- package/dist/esm/data-structures/trie/trie.js +193 -172
- package/dist/esm/data-structures/trie/trie.js.map +1 -1
- package/dist/esm/interfaces/binary-tree.d.ts +56 -6
- package/dist/esm/interfaces/graph.d.ts +16 -0
- package/dist/esm/types/data-structures/base/base.d.ts +1 -1
- package/dist/esm/types/data-structures/graph/abstract-graph.d.ts +4 -0
- package/dist/esm/types/utils/utils.d.ts +1 -0
- package/dist/esm/utils/utils.d.ts +1 -1
- package/dist/esm/utils/utils.js +2 -1
- package/dist/esm/utils/utils.js.map +1 -1
- package/dist/umd/data-structure-typed.js +4685 -6477
- package/dist/umd/data-structure-typed.min.js +8 -6
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/package.json +3 -4
- package/src/data-structures/base/iterable-element-base.ts +238 -115
- package/src/data-structures/base/iterable-entry-base.ts +96 -120
- package/src/data-structures/base/linear-base.ts +271 -277
- package/src/data-structures/binary-tree/avl-tree-counter.ts +198 -216
- package/src/data-structures/binary-tree/avl-tree-multi-map.ts +192 -101
- package/src/data-structures/binary-tree/avl-tree.ts +239 -206
- package/src/data-structures/binary-tree/binary-tree.ts +660 -889
- package/src/data-structures/binary-tree/bst.ts +568 -570
- package/src/data-structures/binary-tree/red-black-tree.ts +161 -222
- package/src/data-structures/binary-tree/tree-counter.ts +199 -218
- package/src/data-structures/binary-tree/tree-multi-map.ts +131 -97
- package/src/data-structures/graph/abstract-graph.ts +339 -264
- package/src/data-structures/graph/directed-graph.ts +146 -236
- package/src/data-structures/graph/map-graph.ts +63 -60
- package/src/data-structures/graph/undirected-graph.ts +129 -152
- package/src/data-structures/hash/hash-map.ts +274 -496
- package/src/data-structures/heap/heap.ts +389 -402
- package/src/data-structures/heap/max-heap.ts +12 -76
- package/src/data-structures/heap/min-heap.ts +13 -76
- package/src/data-structures/linked-list/doubly-linked-list.ts +426 -530
- package/src/data-structures/linked-list/singly-linked-list.ts +495 -517
- package/src/data-structures/linked-list/skip-linked-list.ts +1 -108
- package/src/data-structures/priority-queue/max-priority-queue.ts +12 -87
- package/src/data-structures/priority-queue/min-priority-queue.ts +11 -88
- package/src/data-structures/priority-queue/priority-queue.ts +3 -92
- package/src/data-structures/queue/deque.ts +381 -357
- package/src/data-structures/queue/queue.ts +310 -264
- package/src/data-structures/stack/stack.ts +217 -131
- package/src/data-structures/trie/trie.ts +240 -175
- package/src/interfaces/binary-tree.ts +240 -6
- package/src/interfaces/graph.ts +37 -0
- package/src/types/data-structures/base/base.ts +5 -5
- package/src/types/data-structures/graph/abstract-graph.ts +5 -0
- package/src/types/utils/utils.ts +2 -0
- package/src/utils/utils.ts +9 -14
- package/test/integration/index.html +1 -1
- package/test/performance/benchmark-runner.ts +528 -0
- package/test/performance/reportor.mjs +43 -43
- package/test/performance/runner-config.json +39 -0
- package/test/performance/single-suite-runner.ts +69 -0
- package/test/unit/data-structures/binary-tree/avl-tree-counter.test.ts +3 -3
- package/test/unit/data-structures/binary-tree/avl-tree-multi-map.test.ts +5 -5
- package/test/unit/data-structures/binary-tree/avl-tree.test.ts +4 -4
- package/test/unit/data-structures/binary-tree/binary-tree.test.ts +350 -90
- package/test/unit/data-structures/binary-tree/bst.test.ts +12 -9
- package/test/unit/data-structures/binary-tree/red-black-tree.test.ts +2 -2
- package/test/unit/data-structures/binary-tree/tree-counter.test.ts +25 -24
- package/test/unit/data-structures/binary-tree/tree-multi-map.test.ts +3 -3
- package/test/unit/data-structures/graph/abstract-graph.test.ts +0 -4
- package/test/unit/data-structures/graph/directed-graph.test.ts +1 -1
- package/test/unit/data-structures/heap/heap.test.ts +14 -21
- package/test/unit/data-structures/heap/max-heap.test.ts +5 -9
- package/test/unit/data-structures/heap/min-heap.test.ts +1 -4
- package/test/unit/data-structures/linked-list/doubly-linked-list.test.ts +14 -14
- package/test/unit/data-structures/linked-list/singly-linked-list.test.ts +0 -7
- package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +8 -11
- package/test/unit/data-structures/priority-queue/min-priority-queue.test.ts +1 -4
- package/test/unit/data-structures/priority-queue/priority-queue.test.ts +1 -4
- package/test/unit/data-structures/queue/queue.test.ts +4 -5
- package/test/unit/utils/utils.test.ts +0 -1
- package/test/performance/data-structures/binary-tree/avl-tree.test.mjs +0 -71
- package/test/performance/data-structures/binary-tree/red-black-tree.test.mjs +0 -81
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* data-structure-typed
|
|
3
|
+
*
|
|
4
|
+
* @author Pablo Zeng
|
|
5
|
+
* @copyright Copyright (c) 2022 Pablo Zeng <zrwusa@gmail.com>
|
|
6
|
+
* @license MIT License
|
|
7
|
+
*/
|
|
1
8
|
import { IterableElementBase } from '../base';
|
|
2
9
|
/**
|
|
10
|
+
* LIFO stack with array storage and optional record→element conversion.
|
|
11
|
+
* @remarks Time O(1), Space O(1)
|
|
12
|
+
* @template E
|
|
13
|
+
* @template R
|
|
3
14
|
* 1. Last In, First Out (LIFO): The core characteristic of a stack is its last in, first out nature, meaning the last element added to the stack will be the first to be removed.
|
|
4
15
|
* 2. Uses: Stacks are commonly used for managing a series of tasks or elements that need to be processed in a last in, first out manner. They are widely used in various scenarios, such as in function calls in programming languages, evaluation of arithmetic expressions, and backtracking algorithms.
|
|
5
16
|
* 3. Performance: Stack operations are typically O(1) in time complexity, meaning that regardless of the stack's size, adding, removing, and viewing the top element are very fast operations.
|
|
@@ -129,214 +140,259 @@ import { IterableElementBase } from '../base';
|
|
|
129
140
|
* console.log(spans); // [1, 1, 1, 2, 1, 4, 6]
|
|
130
141
|
*/
|
|
131
142
|
export class Stack extends IterableElementBase {
|
|
143
|
+
_equals = Object.is;
|
|
144
|
+
/**
|
|
145
|
+
* Create a Stack and optionally bulk-push elements.
|
|
146
|
+
* @remarks Time O(N), Space O(N)
|
|
147
|
+
* @param [elements] - Iterable of elements (or raw records if toElementFn is set).
|
|
148
|
+
* @param [options] - Options such as toElementFn and equality function.
|
|
149
|
+
* @returns New Stack instance.
|
|
150
|
+
*/
|
|
132
151
|
constructor(elements = [], options) {
|
|
133
152
|
super(options);
|
|
134
153
|
this.pushMany(elements);
|
|
135
154
|
}
|
|
136
155
|
_elements = [];
|
|
137
156
|
/**
|
|
138
|
-
*
|
|
139
|
-
* @
|
|
157
|
+
* Get the backing array of elements.
|
|
158
|
+
* @remarks Time O(1), Space O(1)
|
|
159
|
+
* @returns Internal elements array.
|
|
140
160
|
*/
|
|
141
161
|
get elements() {
|
|
142
162
|
return this._elements;
|
|
143
163
|
}
|
|
144
164
|
/**
|
|
145
|
-
*
|
|
146
|
-
* @
|
|
165
|
+
* Get the number of stored elements.
|
|
166
|
+
* @remarks Time O(1), Space O(1)
|
|
167
|
+
* @returns Current size.
|
|
147
168
|
*/
|
|
148
169
|
get size() {
|
|
149
170
|
return this.elements.length;
|
|
150
171
|
}
|
|
151
172
|
/**
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
* @param
|
|
157
|
-
* @
|
|
158
|
-
*
|
|
173
|
+
* Create a stack from an array of elements.
|
|
174
|
+
* @remarks Time O(N), Space O(N)
|
|
175
|
+
* @template E
|
|
176
|
+
* @template R
|
|
177
|
+
* @param this - The constructor (subclass) to instantiate.
|
|
178
|
+
* @param elements - Array of elements to push in order.
|
|
179
|
+
* @param [options] - Options forwarded to the constructor.
|
|
180
|
+
* @returns A new Stack populated from the array.
|
|
159
181
|
*/
|
|
160
|
-
static fromArray(elements) {
|
|
161
|
-
return new
|
|
182
|
+
static fromArray(elements, options) {
|
|
183
|
+
return new this(elements, options);
|
|
162
184
|
}
|
|
163
185
|
/**
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
* The function checks if an array is empty and returns a boolean value.
|
|
168
|
-
* @returns A boolean value indicating whether the `_elements` array is empty or not.
|
|
186
|
+
* Check whether the stack is empty.
|
|
187
|
+
* @remarks Time O(1), Space O(1)
|
|
188
|
+
* @returns True if size is 0.
|
|
169
189
|
*/
|
|
170
190
|
isEmpty() {
|
|
171
191
|
return this.elements.length === 0;
|
|
172
192
|
}
|
|
173
193
|
/**
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
* The `peek` function returns the last element of an array, or undefined if the array is empty.
|
|
178
|
-
* @returns The `peek()` function returns the last element of the `_elements` array, or `undefined` if the array is empty.
|
|
194
|
+
* Get the top element without removing it.
|
|
195
|
+
* @remarks Time O(1), Space O(1)
|
|
196
|
+
* @returns Top element or undefined.
|
|
179
197
|
*/
|
|
180
198
|
peek() {
|
|
181
|
-
|
|
182
|
-
return undefined;
|
|
183
|
-
return this.elements[this.elements.length - 1];
|
|
199
|
+
return this.isEmpty() ? undefined : this.elements[this.elements.length - 1];
|
|
184
200
|
}
|
|
185
201
|
/**
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
* @param {E} element - The parameter "element" is of type E, which means it can be any data type.
|
|
191
|
-
* @returns The `push` method is returning the updated `Stack<E>` object.
|
|
202
|
+
* Push one element onto the top.
|
|
203
|
+
* @remarks Time O(1), Space O(1)
|
|
204
|
+
* @param element - Element to push.
|
|
205
|
+
* @returns True when pushed.
|
|
192
206
|
*/
|
|
193
207
|
push(element) {
|
|
194
208
|
this.elements.push(element);
|
|
195
209
|
return true;
|
|
196
210
|
}
|
|
197
211
|
/**
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
* The `pop` function removes and returns the last element from an array, or returns undefined if the array is empty.
|
|
202
|
-
* @returns The `pop()` method is returning the last element of the array `_elements` if the array is not empty. If the
|
|
203
|
-
* array is empty, it returns `undefined`.
|
|
212
|
+
* Pop and return the top element.
|
|
213
|
+
* @remarks Time O(1), Space O(1)
|
|
214
|
+
* @returns Removed element or undefined.
|
|
204
215
|
*/
|
|
205
216
|
pop() {
|
|
206
|
-
|
|
207
|
-
return;
|
|
208
|
-
return this.elements.pop();
|
|
217
|
+
return this.isEmpty() ? undefined : this.elements.pop();
|
|
209
218
|
}
|
|
210
219
|
/**
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
* transformation function if provided.
|
|
216
|
-
* @param {Iterable<E> | Iterable<R>} elements - The `elements` parameter in the `pushMany` function
|
|
217
|
-
* is an iterable containing elements of type `E` or `R`. The function iterates over each element in
|
|
218
|
-
* the iterable and pushes it into the data structure. If a transformation function `toElementFn` is
|
|
219
|
-
* provided, it is used to
|
|
220
|
-
* @returns The `pushMany` function is returning an array of boolean values indicating whether each
|
|
221
|
-
* element was successfully pushed into the data structure.
|
|
220
|
+
* Push many elements from an iterable.
|
|
221
|
+
* @remarks Time O(N), Space O(1)
|
|
222
|
+
* @param elements - Iterable of elements (or raw records if toElementFn is set).
|
|
223
|
+
* @returns Array of per-element success flags.
|
|
222
224
|
*/
|
|
223
225
|
pushMany(elements) {
|
|
224
226
|
const ans = [];
|
|
225
227
|
for (const el of elements) {
|
|
226
|
-
if (this.toElementFn)
|
|
228
|
+
if (this.toElementFn)
|
|
227
229
|
ans.push(this.push(this.toElementFn(el)));
|
|
228
|
-
|
|
229
|
-
else {
|
|
230
|
+
else
|
|
230
231
|
ans.push(this.push(el));
|
|
231
|
-
}
|
|
232
232
|
}
|
|
233
233
|
return ans;
|
|
234
234
|
}
|
|
235
235
|
/**
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
* @returns An array of type E.
|
|
236
|
+
* Delete the first occurrence of a specific element.
|
|
237
|
+
* @remarks Time O(N), Space O(1)
|
|
238
|
+
* @param element - Element to remove (using the configured equality).
|
|
239
|
+
* @returns True if an element was removed.
|
|
241
240
|
*/
|
|
242
241
|
delete(element) {
|
|
243
|
-
const
|
|
244
|
-
return this.deleteAt(
|
|
242
|
+
const idx = this._indexOfByEquals(element);
|
|
243
|
+
return this.deleteAt(idx);
|
|
245
244
|
}
|
|
246
245
|
/**
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
* @returns An array of type E.
|
|
246
|
+
* Delete the element at an index.
|
|
247
|
+
* @remarks Time O(N), Space O(1)
|
|
248
|
+
* @param index - Zero-based index from the bottom.
|
|
249
|
+
* @returns True if removed.
|
|
252
250
|
*/
|
|
253
251
|
deleteAt(index) {
|
|
252
|
+
if (index < 0 || index >= this.elements.length)
|
|
253
|
+
return false;
|
|
254
254
|
const spliced = this.elements.splice(index, 1);
|
|
255
255
|
return spliced.length === 1;
|
|
256
256
|
}
|
|
257
257
|
/**
|
|
258
|
-
*
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
258
|
+
* Delete the first element that satisfies a predicate.
|
|
259
|
+
* @remarks Time O(N), Space O(1)
|
|
260
|
+
* @param predicate - Function (value, index, stack) → boolean to decide deletion.
|
|
261
|
+
* @returns True if a match was removed.
|
|
262
|
+
*/
|
|
263
|
+
deleteWhere(predicate) {
|
|
264
|
+
for (let i = 0; i < this.elements.length; i++) {
|
|
265
|
+
if (predicate(this.elements[i], i, this)) {
|
|
266
|
+
this.elements.splice(i, 1);
|
|
267
|
+
return true;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return false;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Remove all elements and reset storage.
|
|
274
|
+
* @remarks Time O(1), Space O(1)
|
|
275
|
+
* @returns void
|
|
262
276
|
*/
|
|
263
277
|
clear() {
|
|
264
278
|
this._elements = [];
|
|
265
279
|
}
|
|
266
280
|
/**
|
|
267
|
-
*
|
|
268
|
-
*
|
|
269
|
-
*
|
|
270
|
-
* The `clone()` function returns a new `Stack` object with the same elements as the original stack.
|
|
271
|
-
* @returns The `clone()` method is returning a new `Stack` object with a copy of the `_elements` array.
|
|
281
|
+
* Deep clone this stack.
|
|
282
|
+
* @remarks Time O(N), Space O(N)
|
|
283
|
+
* @returns A new stack with the same content.
|
|
272
284
|
*/
|
|
273
285
|
clone() {
|
|
274
|
-
|
|
286
|
+
const out = this._createInstance({ toElementFn: this.toElementFn });
|
|
287
|
+
for (const v of this)
|
|
288
|
+
out.push(v);
|
|
289
|
+
return out;
|
|
275
290
|
}
|
|
276
291
|
/**
|
|
277
|
-
*
|
|
278
|
-
*
|
|
279
|
-
*
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
* @param predicate - The `predicate` parameter is a callback function that takes three arguments:
|
|
283
|
-
* the current element being iterated over, the index of the current element, and the stack itself.
|
|
284
|
-
* It should return a boolean value indicating whether the element should be included in the filtered
|
|
285
|
-
* stack or not.
|
|
286
|
-
* @param {any} [thisArg] - The `thisArg` parameter is an optional argument that specifies the value
|
|
287
|
-
* to be used as `this` when executing the `predicate` function. If `thisArg` is provided, it will be
|
|
288
|
-
* passed as the `this` value to the `predicate` function. If `thisArg` is
|
|
289
|
-
* @returns The `filter` method is returning a new `Stack` object that contains the elements that
|
|
290
|
-
* satisfy the given predicate function.
|
|
292
|
+
* Filter elements into a new stack of the same class.
|
|
293
|
+
* @remarks Time O(N), Space O(N)
|
|
294
|
+
* @param predicate - Predicate (value, index, stack) → boolean to keep value.
|
|
295
|
+
* @param [thisArg] - Value for `this` inside the predicate.
|
|
296
|
+
* @returns A new stack with kept values.
|
|
291
297
|
*/
|
|
292
298
|
filter(predicate, thisArg) {
|
|
293
|
-
const
|
|
299
|
+
const out = this._createInstance({ toElementFn: this.toElementFn });
|
|
294
300
|
let index = 0;
|
|
295
|
-
for (const
|
|
296
|
-
if (predicate.call(thisArg,
|
|
297
|
-
|
|
298
|
-
}
|
|
301
|
+
for (const v of this) {
|
|
302
|
+
if (predicate.call(thisArg, v, index, this))
|
|
303
|
+
out.push(v);
|
|
299
304
|
index++;
|
|
300
305
|
}
|
|
301
|
-
return
|
|
306
|
+
return out;
|
|
302
307
|
}
|
|
303
308
|
/**
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
* @param callback - The callback parameter is a function that will be called for each element in the
|
|
310
|
-
* stack. It takes three arguments: the current element, the index of the element, and the stack
|
|
311
|
-
* itself. It should return a new value that will be added to the new stack.
|
|
312
|
-
* @param [toElementFn] - The `toElementFn` parameter is an optional function that can be used to
|
|
313
|
-
* transform the raw element (`RM`) into a new element (`EM`) before pushing it into the new stack.
|
|
314
|
-
* @param {any} [thisArg] - The `thisArg` parameter is an optional argument that allows you to
|
|
315
|
-
* specify the value of `this` within the callback function. It is used to set the context or scope
|
|
316
|
-
* in which the callback function will be executed. If `thisArg` is provided, it will be used as the
|
|
317
|
-
* value of
|
|
318
|
-
* @returns a new Stack object with elements of type EM and raw elements of type RM.
|
|
309
|
+
* Map values into a new stack of the same element type.
|
|
310
|
+
* @remarks Time O(N), Space O(N)
|
|
311
|
+
* @param callback - Mapping function (value, index, stack) → newValue.
|
|
312
|
+
* @param [thisArg] - Value for `this` inside the callback.
|
|
313
|
+
* @returns A new stack with mapped values.
|
|
319
314
|
*/
|
|
320
|
-
|
|
321
|
-
const
|
|
315
|
+
mapSame(callback, thisArg) {
|
|
316
|
+
const out = this._createInstance({ toElementFn: this.toElementFn });
|
|
322
317
|
let index = 0;
|
|
323
|
-
for (const
|
|
324
|
-
|
|
318
|
+
for (const v of this) {
|
|
319
|
+
const mv = thisArg === undefined ? callback(v, index++, this) : callback.call(thisArg, v, index++, this);
|
|
320
|
+
out.push(mv);
|
|
321
|
+
}
|
|
322
|
+
return out;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Map values into a new stack (possibly different element type).
|
|
326
|
+
* @remarks Time O(N), Space O(N)
|
|
327
|
+
* @template EM
|
|
328
|
+
* @template RM
|
|
329
|
+
* @param callback - Mapping function (value, index, stack) → newElement.
|
|
330
|
+
* @param [options] - Options for the output stack (e.g., toElementFn).
|
|
331
|
+
* @param [thisArg] - Value for `this` inside the callback.
|
|
332
|
+
* @returns A new Stack with mapped elements.
|
|
333
|
+
*/
|
|
334
|
+
map(callback, options, thisArg) {
|
|
335
|
+
const out = this._createLike([], { ...(options ?? {}) });
|
|
336
|
+
let index = 0;
|
|
337
|
+
for (const v of this) {
|
|
338
|
+
out.push(thisArg === undefined ? callback(v, index, this) : callback.call(thisArg, v, index, this));
|
|
325
339
|
index++;
|
|
326
340
|
}
|
|
327
|
-
return
|
|
341
|
+
return out;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Set the equality comparator used by delete/search operations.
|
|
345
|
+
* @remarks Time O(1), Space O(1)
|
|
346
|
+
* @param equals - Equality predicate (a, b) → boolean.
|
|
347
|
+
* @returns This stack.
|
|
348
|
+
*/
|
|
349
|
+
setEquality(equals) {
|
|
350
|
+
this._equals = equals;
|
|
351
|
+
return this;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* (Protected) Find the index of a target element using the equality function.
|
|
355
|
+
* @remarks Time O(N), Space O(1)
|
|
356
|
+
* @param target - Element to search for.
|
|
357
|
+
* @returns Index or -1 if not found.
|
|
358
|
+
*/
|
|
359
|
+
_indexOfByEquals(target) {
|
|
360
|
+
for (let i = 0; i < this.elements.length; i++)
|
|
361
|
+
if (this._equals(this.elements[i], target))
|
|
362
|
+
return i;
|
|
363
|
+
return -1;
|
|
328
364
|
}
|
|
329
365
|
/**
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
334
|
-
|
|
366
|
+
* (Protected) Create an empty instance of the same concrete class.
|
|
367
|
+
* @remarks Time O(1), Space O(1)
|
|
368
|
+
* @param [options] - Options forwarded to the constructor.
|
|
369
|
+
* @returns An empty like-kind stack instance.
|
|
370
|
+
*/
|
|
371
|
+
_createInstance(options) {
|
|
372
|
+
const Ctor = this.constructor;
|
|
373
|
+
return new Ctor([], options);
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* (Protected) Create a like-kind stack and seed it from an iterable.
|
|
377
|
+
* @remarks Time O(N), Space O(N)
|
|
378
|
+
* @template T
|
|
379
|
+
* @template RR
|
|
380
|
+
* @param [elements] - Iterable used to seed the new stack.
|
|
381
|
+
* @param [options] - Options forwarded to the constructor.
|
|
382
|
+
* @returns A like-kind Stack instance.
|
|
383
|
+
*/
|
|
384
|
+
_createLike(elements = [], options) {
|
|
385
|
+
const Ctor = this.constructor;
|
|
386
|
+
return new Ctor(elements, options);
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* (Protected) Iterate elements from bottom to top.
|
|
390
|
+
* @remarks Time O(N), Space O(1)
|
|
391
|
+
* @returns Iterator of elements.
|
|
335
392
|
*/
|
|
336
393
|
*_getIterator() {
|
|
337
|
-
for (let i = 0; i < this.elements.length; i++)
|
|
394
|
+
for (let i = 0; i < this.elements.length; i++)
|
|
338
395
|
yield this.elements[i];
|
|
339
|
-
}
|
|
340
396
|
}
|
|
341
397
|
}
|
|
342
398
|
//# sourceMappingURL=stack.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stack.js","sourceRoot":"","sources":["../../../../src/data-structures/stack/stack.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stack.js","sourceRoot":"","sources":["../../../../src/data-structures/stack/stack.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoIG;AACH,MAAM,OAAO,KAAwB,SAAQ,mBAAyB;IAC1D,OAAO,GAA4B,MAAM,CAAC,EAAwC,CAAC;IAE7F;;;;;;OAMG;IAEH,YAAY,WAAsC,EAAE,EAAE,OAA4B;QAChF,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,QAAQ,CAAC,QAA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