data-structure-typed 2.5.1 → 2.5.3

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 (184) hide show
  1. package/CHANGELOG.md +5 -1
  2. package/MIGRATION.md +169 -0
  3. package/README.md +135 -23
  4. package/README_CN.md +551 -143
  5. package/SPECIFICATION.md +20 -14
  6. package/SPECIFICATION.zh-CN.md +20 -14
  7. package/dist/cjs/binary-tree.cjs +6460 -1591
  8. package/dist/cjs/graph.cjs +440 -20
  9. package/dist/cjs/hash.cjs +125 -22
  10. package/dist/cjs/heap.cjs +196 -47
  11. package/dist/cjs/index.cjs +8486 -2429
  12. package/dist/cjs/linked-list.cjs +456 -31
  13. package/dist/cjs/matrix.cjs +79 -9
  14. package/dist/cjs/priority-queue.cjs +193 -44
  15. package/dist/cjs/queue.cjs +391 -2
  16. package/dist/cjs/stack.cjs +92 -6
  17. package/dist/cjs/trie.cjs +122 -28
  18. package/dist/cjs-legacy/binary-tree.cjs +6484 -1612
  19. package/dist/cjs-legacy/graph.cjs +440 -20
  20. package/dist/cjs-legacy/hash.cjs +125 -22
  21. package/dist/cjs-legacy/heap.cjs +196 -47
  22. package/dist/cjs-legacy/index.cjs +8654 -2594
  23. package/dist/cjs-legacy/linked-list.cjs +456 -31
  24. package/dist/cjs-legacy/matrix.cjs +79 -9
  25. package/dist/cjs-legacy/priority-queue.cjs +193 -44
  26. package/dist/cjs-legacy/queue.cjs +391 -2
  27. package/dist/cjs-legacy/stack.cjs +92 -6
  28. package/dist/cjs-legacy/trie.cjs +122 -28
  29. package/dist/esm/binary-tree.mjs +6460 -1591
  30. package/dist/esm/graph.mjs +440 -20
  31. package/dist/esm/hash.mjs +125 -22
  32. package/dist/esm/heap.mjs +196 -47
  33. package/dist/esm/index.mjs +8486 -2430
  34. package/dist/esm/linked-list.mjs +456 -31
  35. package/dist/esm/matrix.mjs +79 -9
  36. package/dist/esm/priority-queue.mjs +193 -44
  37. package/dist/esm/queue.mjs +391 -2
  38. package/dist/esm/stack.mjs +92 -6
  39. package/dist/esm/trie.mjs +122 -28
  40. package/dist/esm-legacy/binary-tree.mjs +6484 -1612
  41. package/dist/esm-legacy/graph.mjs +440 -20
  42. package/dist/esm-legacy/hash.mjs +125 -22
  43. package/dist/esm-legacy/heap.mjs +196 -47
  44. package/dist/esm-legacy/index.mjs +8654 -2595
  45. package/dist/esm-legacy/linked-list.mjs +456 -31
  46. package/dist/esm-legacy/matrix.mjs +79 -9
  47. package/dist/esm-legacy/priority-queue.mjs +193 -44
  48. package/dist/esm-legacy/queue.mjs +391 -2
  49. package/dist/esm-legacy/stack.mjs +92 -6
  50. package/dist/esm-legacy/trie.mjs +122 -28
  51. package/dist/types/common/error.d.ts +9 -0
  52. package/dist/types/common/index.d.ts +1 -1
  53. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +98 -2
  54. package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +112 -0
  55. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +214 -13
  56. package/dist/types/data-structures/binary-tree/bst.d.ts +294 -3
  57. package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +155 -8
  58. package/dist/types/data-structures/binary-tree/segment-tree.d.ts +48 -0
  59. package/dist/types/data-structures/binary-tree/tree-map.d.ts +1370 -323
  60. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +1329 -316
  61. package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +1116 -295
  62. package/dist/types/data-structures/binary-tree/tree-set.d.ts +1330 -326
  63. package/dist/types/data-structures/graph/directed-graph.d.ts +80 -0
  64. package/dist/types/data-structures/graph/undirected-graph.d.ts +72 -0
  65. package/dist/types/data-structures/hash/hash-map.d.ts +95 -6
  66. package/dist/types/data-structures/heap/heap.d.ts +154 -12
  67. package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +143 -0
  68. package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +121 -1
  69. package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +144 -0
  70. package/dist/types/data-structures/matrix/matrix.d.ts +64 -0
  71. package/dist/types/data-structures/queue/deque.d.ts +142 -0
  72. package/dist/types/data-structures/queue/queue.d.ts +109 -0
  73. package/dist/types/data-structures/stack/stack.d.ts +82 -2
  74. package/dist/types/data-structures/trie/trie.d.ts +96 -0
  75. package/dist/types/interfaces/binary-tree.d.ts +2 -3
  76. package/dist/types/types/data-structures/binary-tree/bst.d.ts +1 -0
  77. package/dist/types/types/data-structures/binary-tree/tree-map.d.ts +5 -0
  78. package/dist/types/types/data-structures/binary-tree/tree-multi-set.d.ts +4 -0
  79. package/dist/types/types/data-structures/binary-tree/tree-set.d.ts +4 -0
  80. package/dist/umd/data-structure-typed.js +8623 -2564
  81. package/dist/umd/data-structure-typed.min.js +5 -5
  82. package/docs-site-docusaurus/docs/api/classes/AVLTree.md +696 -194
  83. package/docs-site-docusaurus/docs/api/classes/AVLTreeNode.md +11 -11
  84. package/docs-site-docusaurus/docs/api/classes/AbstractGraph.md +71 -71
  85. package/docs-site-docusaurus/docs/api/classes/BST.md +639 -189
  86. package/docs-site-docusaurus/docs/api/classes/BSTNode.md +13 -13
  87. package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +15 -15
  88. package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +148 -160
  89. package/docs-site-docusaurus/docs/api/classes/BinaryTreeNode.md +13 -13
  90. package/docs-site-docusaurus/docs/api/classes/Deque.md +105 -91
  91. package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +82 -82
  92. package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +104 -74
  93. package/docs-site-docusaurus/docs/api/classes/DoublyLinkedListNode.md +8 -8
  94. package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +12 -12
  95. package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +1 -1
  96. package/docs-site-docusaurus/docs/api/classes/HashMap.md +51 -51
  97. package/docs-site-docusaurus/docs/api/classes/Heap.md +96 -85
  98. package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +25 -25
  99. package/docs-site-docusaurus/docs/api/classes/IterableEntryBase.md +33 -33
  100. package/docs-site-docusaurus/docs/api/classes/LinearBase.md +50 -50
  101. package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +55 -55
  102. package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +55 -55
  103. package/docs-site-docusaurus/docs/api/classes/LinkedListNode.md +6 -6
  104. package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +78 -78
  105. package/docs-site-docusaurus/docs/api/classes/MapGraph.md +82 -82
  106. package/docs-site-docusaurus/docs/api/classes/Matrix.md +31 -31
  107. package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +104 -89
  108. package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +104 -89
  109. package/docs-site-docusaurus/docs/api/classes/MinHeap.md +104 -89
  110. package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +104 -89
  111. package/docs-site-docusaurus/docs/api/classes/Navigator.md +5 -5
  112. package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +103 -88
  113. package/docs-site-docusaurus/docs/api/classes/Queue.md +112 -60
  114. package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +708 -206
  115. package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +10 -10
  116. package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +79 -79
  117. package/docs-site-docusaurus/docs/api/classes/SinglyLinkedListNode.md +6 -6
  118. package/docs-site-docusaurus/docs/api/classes/SkipList.md +44 -44
  119. package/docs-site-docusaurus/docs/api/classes/Stack.md +42 -42
  120. package/docs-site-docusaurus/docs/api/classes/TreeMap.md +236 -33
  121. package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +162 -46
  122. package/docs-site-docusaurus/docs/api/classes/TreeSet.md +232 -32
  123. package/docs-site-docusaurus/docs/api/classes/Trie.md +47 -47
  124. package/docs-site-docusaurus/docs/api/classes/TrieNode.md +8 -8
  125. package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +81 -81
  126. package/docs-site-docusaurus/docs/guide/architecture.md +75 -5
  127. package/docs-site-docusaurus/docs/guide/concepts.md +53 -3
  128. package/docs-site-docusaurus/docs/guide/faq.md +233 -0
  129. package/docs-site-docusaurus/docs/guide/guides.md +43 -58
  130. package/docs-site-docusaurus/docs/guide/installation.md +2 -0
  131. package/docs-site-docusaurus/docs/guide/integrations.md +75 -176
  132. package/docs-site-docusaurus/docs/guide/overview.md +132 -11
  133. package/docs-site-docusaurus/docs/guide/performance.md +2 -0
  134. package/docs-site-docusaurus/docs/guide/quick-start.md +31 -0
  135. package/docs-site-docusaurus/docs/guide/use-cases/_category_.json +6 -0
  136. package/docs-site-docusaurus/docs/guide/use-cases/array-sort-alternative.md +158 -0
  137. package/docs-site-docusaurus/docs/guide/use-cases/heap-vs-sorting.md +92 -0
  138. package/docs-site-docusaurus/docs/guide/use-cases/map-vs-treemap.md +151 -0
  139. package/docs-site-docusaurus/docs/guide/use-cases/priority-queue-typescript.md +113 -0
  140. package/docs-site-docusaurus/docs/guide/use-cases/treemap-javascript.md +151 -0
  141. package/docs-site-docusaurus/docusaurus.config.ts +1 -1
  142. package/docs-site-docusaurus/src/pages/index.tsx +55 -2
  143. package/docs-site-docusaurus/static/llms.txt +37 -0
  144. package/docs-site-docusaurus/typedoc.json +1 -0
  145. package/llms.txt +37 -0
  146. package/package.json +65 -56
  147. package/src/common/error.ts +19 -1
  148. package/src/common/index.ts +1 -1
  149. package/src/data-structures/base/iterable-element-base.ts +3 -2
  150. package/src/data-structures/binary-tree/avl-tree.ts +99 -5
  151. package/src/data-structures/binary-tree/binary-indexed-tree.ts +102 -4
  152. package/src/data-structures/binary-tree/binary-tree.ts +239 -78
  153. package/src/data-structures/binary-tree/bst.ts +542 -13
  154. package/src/data-structures/binary-tree/red-black-tree.ts +155 -15
  155. package/src/data-structures/binary-tree/segment-tree.ts +42 -0
  156. package/src/data-structures/binary-tree/tree-map.ts +1223 -261
  157. package/src/data-structures/binary-tree/tree-multi-map.ts +939 -30
  158. package/src/data-structures/binary-tree/tree-multi-set.ts +746 -10
  159. package/src/data-structures/binary-tree/tree-set.ts +1018 -99
  160. package/src/data-structures/graph/abstract-graph.ts +2 -2
  161. package/src/data-structures/graph/directed-graph.ts +71 -1
  162. package/src/data-structures/graph/undirected-graph.ts +64 -1
  163. package/src/data-structures/hash/hash-map.ts +102 -16
  164. package/src/data-structures/heap/heap.ts +153 -23
  165. package/src/data-structures/heap/max-heap.ts +2 -2
  166. package/src/data-structures/linked-list/doubly-linked-list.ts +139 -0
  167. package/src/data-structures/linked-list/singly-linked-list.ts +106 -1
  168. package/src/data-structures/linked-list/skip-linked-list.ts +131 -5
  169. package/src/data-structures/matrix/matrix.ts +65 -9
  170. package/src/data-structures/priority-queue/max-priority-queue.ts +2 -2
  171. package/src/data-structures/queue/deque.ts +130 -0
  172. package/src/data-structures/queue/queue.ts +109 -0
  173. package/src/data-structures/stack/stack.ts +75 -5
  174. package/src/data-structures/trie/trie.ts +86 -2
  175. package/src/interfaces/binary-tree.ts +1 -9
  176. package/src/types/data-structures/binary-tree/bst.ts +1 -0
  177. package/src/types/data-structures/binary-tree/tree-map.ts +6 -0
  178. package/src/types/data-structures/binary-tree/tree-multi-set.ts +5 -0
  179. package/src/types/data-structures/binary-tree/tree-set.ts +5 -0
  180. package/.vitepress/cache/deps_temp_51f5f1b0/chunk-7OIKW5WK.js +0 -12984
  181. package/.vitepress/cache/deps_temp_51f5f1b0/package.json +0 -3
  182. package/.vitepress/cache/deps_temp_51f5f1b0/vitepress___@vue_devtools-api.js +0 -4505
  183. package/.vitepress/cache/deps_temp_51f5f1b0/vitepress___@vueuse_core.js +0 -9731
  184. package/.vitepress/cache/deps_temp_51f5f1b0/vue.js +0 -347
@@ -189,6 +189,13 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
189
189
 
190
190
 
191
191
 
192
+
193
+
194
+
195
+
196
+
197
+
198
+
192
199
 
193
200
 
194
201
 
@@ -212,6 +219,29 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
212
219
  * // Length unchanged
213
220
  * console.log(deque.length); // 5;
214
221
  */
222
+ /**
223
+ * Peek at the front element without removing it (alias for `first`).
224
+ * @remarks Time O(1), Space O(1)
225
+ * @returns Front element or undefined.
226
+ */
227
+ peek(): E | undefined;
228
+ /**
229
+ * Deque peek at both ends
230
+ * @example
231
+ * // Deque peek at both ends
232
+ * const deque = new Deque<number>([10, 20, 30, 40, 50]);
233
+ *
234
+ * // Get first element without removing
235
+ * const first = deque.at(0);
236
+ * console.log(first); // 10;
237
+ *
238
+ * // Get last element without removing
239
+ * const last = deque.at(deque.length - 1);
240
+ * console.log(last); // 50;
241
+ *
242
+ * // Length unchanged
243
+ * console.log(deque.length); // 5;
244
+ */
215
245
  get first(): E | undefined;
216
246
  /**
217
247
  * Get the last element without removing it.
@@ -239,6 +269,14 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
239
269
 
240
270
 
241
271
 
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+
242
280
 
243
281
 
244
282
 
@@ -293,6 +331,14 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
293
331
 
294
332
 
295
333
 
334
+
335
+
336
+
337
+
338
+
339
+
340
+
341
+
296
342
 
297
343
 
298
344
 
@@ -348,6 +394,14 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
348
394
 
349
395
 
350
396
 
397
+
398
+
399
+
400
+
401
+
402
+
403
+
404
+
351
405
 
352
406
 
353
407
 
@@ -390,6 +444,14 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
390
444
 
391
445
 
392
446
 
447
+
448
+
449
+
450
+
451
+
452
+
453
+
454
+
393
455
 
394
456
 
395
457
 
@@ -433,6 +495,14 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
433
495
 
434
496
 
435
497
 
498
+
499
+
500
+
501
+
502
+
503
+
504
+
505
+
436
506
 
437
507
 
438
508
 
@@ -497,6 +567,14 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
497
567
 
498
568
 
499
569
 
570
+
571
+
572
+
573
+
574
+
575
+
576
+
577
+
500
578
 
501
579
 
502
580
 
@@ -536,6 +614,14 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
536
614
 
537
615
 
538
616
 
617
+
618
+
619
+
620
+
621
+
622
+
623
+
624
+
539
625
 
540
626
 
541
627
 
@@ -576,6 +662,14 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
576
662
 
577
663
 
578
664
 
665
+
666
+
667
+
668
+
669
+
670
+
671
+
672
+
579
673
 
580
674
 
581
675
 
@@ -665,6 +759,14 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
665
759
 
666
760
 
667
761
 
762
+
763
+
764
+
765
+
766
+
767
+
768
+
769
+
668
770
 
669
771
 
670
772
 
@@ -721,6 +823,14 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
721
823
 
722
824
 
723
825
 
826
+
827
+
828
+
829
+
830
+
831
+
832
+
833
+
724
834
 
725
835
 
726
836
 
@@ -795,6 +905,14 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
795
905
 
796
906
 
797
907
 
908
+
909
+
910
+
911
+
912
+
913
+
914
+
915
+
798
916
 
799
917
 
800
918
 
@@ -838,6 +956,14 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
838
956
 
839
957
 
840
958
 
959
+
960
+
961
+
962
+
963
+
964
+
965
+
966
+
841
967
 
842
968
 
843
969
 
@@ -882,6 +1008,14 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
882
1008
 
883
1009
 
884
1010
 
1011
+
1012
+
1013
+
1014
+
1015
+
1016
+
1017
+
1018
+
885
1019
 
886
1020
 
887
1021
 
@@ -934,6 +1068,14 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
934
1068
 
935
1069
 
936
1070
 
1071
+
1072
+
1073
+
1074
+
1075
+
1076
+
1077
+
1078
+
937
1079
 
938
1080
 
939
1081
 
@@ -149,6 +149,14 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
149
149
 
150
150
 
151
151
 
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
152
160
 
153
161
 
154
162
 
@@ -193,6 +201,14 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
193
201
 
194
202
 
195
203
 
204
+
205
+
206
+
207
+
208
+
209
+
210
+
211
+
196
212
 
197
213
 
198
214
 
@@ -209,6 +225,12 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
209
225
  * console.log(q.length); // 3;
210
226
  */
211
227
  get first(): E | undefined;
228
+ /**
229
+ * Peek at the front element without removing it (alias for `first`).
230
+ * @remarks Time O(1), Space O(1)
231
+ * @returns Front element or undefined.
232
+ */
233
+ peek(): E | undefined;
212
234
  /**
213
235
  * Get the last element (back) without removing it.
214
236
  * @remarks Time O(1), Space O(1)
@@ -249,6 +271,14 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
249
271
 
250
272
 
251
273
 
274
+
275
+
276
+
277
+
278
+
279
+
280
+
281
+
252
282
 
253
283
 
254
284
 
@@ -305,6 +335,14 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
305
335
 
306
336
 
307
337
 
338
+
339
+
340
+
341
+
342
+
343
+
344
+
345
+
308
346
 
309
347
 
310
348
 
@@ -359,6 +397,14 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
359
397
 
360
398
 
361
399
 
400
+
401
+
402
+
403
+
404
+
405
+
406
+
407
+
362
408
 
363
409
 
364
410
 
@@ -408,6 +454,14 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
408
454
 
409
455
 
410
456
 
457
+
458
+
459
+
460
+
461
+
462
+
463
+
464
+
411
465
 
412
466
 
413
467
 
@@ -448,6 +502,14 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
448
502
 
449
503
 
450
504
 
505
+
506
+
507
+
508
+
509
+
510
+
511
+
512
+
451
513
 
452
514
 
453
515
 
@@ -487,6 +549,13 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
487
549
  * @returns True if updated.
488
550
  */
489
551
  setAt(index: number, newElement: E): boolean;
552
+ /**
553
+ * Delete the first element that satisfies a predicate.
554
+ * @remarks Time O(N), Space O(N)
555
+ * @param predicate - Function (value, index, queue) → boolean to decide deletion.
556
+ * @returns True if a match was removed.
557
+ */
558
+ deleteWhere(predicate: (value: E, index: number, queue: this) => boolean): boolean;
490
559
  /**
491
560
  * Reverse the queue in-place by compacting then reversing.
492
561
  * @remarks Time O(N), Space O(N)
@@ -517,6 +586,14 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
517
586
 
518
587
 
519
588
 
589
+
590
+
591
+
592
+
593
+
594
+
595
+
596
+
520
597
 
521
598
 
522
599
 
@@ -556,6 +633,14 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
556
633
 
557
634
 
558
635
 
636
+
637
+
638
+
639
+
640
+
641
+
642
+
643
+
559
644
 
560
645
 
561
646
 
@@ -607,6 +692,14 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
607
692
 
608
693
 
609
694
 
695
+
696
+
697
+
698
+
699
+
700
+
701
+
702
+
610
703
 
611
704
 
612
705
 
@@ -651,6 +744,14 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
651
744
 
652
745
 
653
746
 
747
+
748
+
749
+
750
+
751
+
752
+
753
+
754
+
654
755
 
655
756
 
656
757
 
@@ -695,6 +796,14 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
695
796
 
696
797
 
697
798
 
799
+
800
+
801
+
802
+
803
+
804
+
805
+
806
+
698
807
 
699
808
 
700
809
 
@@ -171,6 +171,14 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
171
171
 
172
172
 
173
173
 
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
174
182
 
175
183
 
176
184
 
@@ -223,6 +231,14 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
223
231
 
224
232
 
225
233
 
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
226
242
 
227
243
 
228
244
 
@@ -266,6 +282,14 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
266
282
 
267
283
 
268
284
 
285
+
286
+
287
+
288
+
289
+
290
+
291
+
292
+
269
293
 
270
294
 
271
295
 
@@ -309,6 +333,14 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
309
333
 
310
334
 
311
335
 
336
+
337
+
338
+
339
+
340
+
341
+
342
+
343
+
312
344
 
313
345
 
314
346
 
@@ -360,6 +392,14 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
360
392
 
361
393
 
362
394
 
395
+
396
+
397
+
398
+
399
+
400
+
401
+
402
+
363
403
 
364
404
 
365
405
 
@@ -420,6 +460,14 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
420
460
 
421
461
 
422
462
 
463
+
464
+
465
+
466
+
467
+
468
+
469
+
470
+
423
471
 
424
472
 
425
473
 
@@ -440,9 +488,9 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
440
488
  * Delete the element at an index.
441
489
  * @remarks Time O(N), Space O(1)
442
490
  * @param index - Zero-based index from the bottom.
443
- * @returns True if removed.
491
+ * @returns The removed element, or undefined if the index is out of range.
444
492
  */
445
- deleteAt(index: number): boolean;
493
+ deleteAt(index: number): E | undefined;
446
494
  /**
447
495
  * Delete the first element that satisfies a predicate.
448
496
  * @remarks Time O(N), Space O(1)
@@ -474,6 +522,14 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
474
522
 
475
523
 
476
524
 
525
+
526
+
527
+
528
+
529
+
530
+
531
+
532
+
477
533
 
478
534
 
479
535
 
@@ -514,6 +570,14 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
514
570
 
515
571
 
516
572
 
573
+
574
+
575
+
576
+
577
+
578
+
579
+
580
+
517
581
 
518
582
 
519
583
 
@@ -558,6 +622,14 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
558
622
 
559
623
 
560
624
 
625
+
626
+
627
+
628
+
629
+
630
+
631
+
632
+
561
633
 
562
634
 
563
635
 
@@ -610,6 +682,14 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
610
682
 
611
683
 
612
684
 
685
+
686
+
687
+
688
+
689
+
690
+
691
+
692
+
613
693
 
614
694
 
615
695