data-structure-typed 2.5.2 → 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 (156) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/MIGRATION.md +169 -0
  3. package/README.md +60 -6
  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 +2417 -132
  8. package/dist/cjs/graph.cjs +248 -14
  9. package/dist/cjs/hash.cjs +62 -7
  10. package/dist/cjs/heap.cjs +103 -16
  11. package/dist/cjs/index.cjs +3046 -124
  12. package/dist/cjs/linked-list.cjs +219 -0
  13. package/dist/cjs/matrix.cjs +32 -0
  14. package/dist/cjs/priority-queue.cjs +101 -14
  15. package/dist/cjs/queue.cjs +215 -0
  16. package/dist/cjs/stack.cjs +44 -4
  17. package/dist/cjs/trie.cjs +44 -0
  18. package/dist/cjs-legacy/binary-tree.cjs +2406 -123
  19. package/dist/cjs-legacy/graph.cjs +248 -14
  20. package/dist/cjs-legacy/hash.cjs +62 -7
  21. package/dist/cjs-legacy/heap.cjs +103 -16
  22. package/dist/cjs-legacy/index.cjs +3105 -185
  23. package/dist/cjs-legacy/linked-list.cjs +219 -0
  24. package/dist/cjs-legacy/matrix.cjs +32 -0
  25. package/dist/cjs-legacy/priority-queue.cjs +101 -14
  26. package/dist/cjs-legacy/queue.cjs +215 -0
  27. package/dist/cjs-legacy/stack.cjs +44 -4
  28. package/dist/cjs-legacy/trie.cjs +44 -0
  29. package/dist/esm/binary-tree.mjs +2417 -132
  30. package/dist/esm/graph.mjs +248 -14
  31. package/dist/esm/hash.mjs +62 -7
  32. package/dist/esm/heap.mjs +103 -16
  33. package/dist/esm/index.mjs +3046 -124
  34. package/dist/esm/linked-list.mjs +219 -0
  35. package/dist/esm/matrix.mjs +32 -0
  36. package/dist/esm/priority-queue.mjs +101 -14
  37. package/dist/esm/queue.mjs +215 -0
  38. package/dist/esm/stack.mjs +44 -4
  39. package/dist/esm/trie.mjs +44 -0
  40. package/dist/esm-legacy/binary-tree.mjs +2406 -123
  41. package/dist/esm-legacy/graph.mjs +248 -14
  42. package/dist/esm-legacy/hash.mjs +62 -7
  43. package/dist/esm-legacy/heap.mjs +103 -16
  44. package/dist/esm-legacy/index.mjs +3105 -185
  45. package/dist/esm-legacy/linked-list.mjs +219 -0
  46. package/dist/esm-legacy/matrix.mjs +32 -0
  47. package/dist/esm-legacy/priority-queue.mjs +101 -14
  48. package/dist/esm-legacy/queue.mjs +215 -0
  49. package/dist/esm-legacy/stack.mjs +44 -4
  50. package/dist/esm-legacy/trie.mjs +44 -0
  51. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +50 -2
  52. package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +56 -0
  53. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +116 -15
  54. package/dist/types/data-structures/binary-tree/bst.d.ts +99 -3
  55. package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +79 -8
  56. package/dist/types/data-structures/binary-tree/segment-tree.d.ts +24 -0
  57. package/dist/types/data-structures/binary-tree/tree-map.d.ts +520 -1
  58. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +489 -1
  59. package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +393 -1
  60. package/dist/types/data-structures/binary-tree/tree-set.d.ts +500 -1
  61. package/dist/types/data-structures/graph/directed-graph.d.ts +40 -0
  62. package/dist/types/data-structures/graph/undirected-graph.d.ts +36 -0
  63. package/dist/types/data-structures/hash/hash-map.d.ts +51 -6
  64. package/dist/types/data-structures/heap/heap.d.ts +98 -12
  65. package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +75 -0
  66. package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +61 -1
  67. package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +72 -0
  68. package/dist/types/data-structures/matrix/matrix.d.ts +32 -0
  69. package/dist/types/data-structures/queue/deque.d.ts +82 -0
  70. package/dist/types/data-structures/queue/queue.d.ts +61 -0
  71. package/dist/types/data-structures/stack/stack.d.ts +42 -2
  72. package/dist/types/data-structures/trie/trie.d.ts +48 -0
  73. package/dist/types/interfaces/binary-tree.d.ts +2 -3
  74. package/dist/umd/data-structure-typed.js +3105 -185
  75. package/dist/umd/data-structure-typed.min.js +4 -4
  76. package/docs-site-docusaurus/docs/api/classes/AVLTree.md +188 -200
  77. package/docs-site-docusaurus/docs/api/classes/AVLTreeNode.md +11 -11
  78. package/docs-site-docusaurus/docs/api/classes/AbstractGraph.md +62 -62
  79. package/docs-site-docusaurus/docs/api/classes/BST.md +183 -195
  80. package/docs-site-docusaurus/docs/api/classes/BSTNode.md +13 -13
  81. package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +15 -15
  82. package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +143 -155
  83. package/docs-site-docusaurus/docs/api/classes/BinaryTreeNode.md +13 -13
  84. package/docs-site-docusaurus/docs/api/classes/Deque.md +99 -85
  85. package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +73 -73
  86. package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +100 -70
  87. package/docs-site-docusaurus/docs/api/classes/DoublyLinkedListNode.md +8 -8
  88. package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +12 -12
  89. package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +1 -1
  90. package/docs-site-docusaurus/docs/api/classes/HashMap.md +38 -38
  91. package/docs-site-docusaurus/docs/api/classes/Heap.md +96 -85
  92. package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +25 -25
  93. package/docs-site-docusaurus/docs/api/classes/IterableEntryBase.md +23 -23
  94. package/docs-site-docusaurus/docs/api/classes/LinearBase.md +48 -48
  95. package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +52 -52
  96. package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +42 -42
  97. package/docs-site-docusaurus/docs/api/classes/LinkedListNode.md +6 -6
  98. package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +74 -74
  99. package/docs-site-docusaurus/docs/api/classes/MapGraph.md +73 -73
  100. package/docs-site-docusaurus/docs/api/classes/Matrix.md +31 -31
  101. package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +104 -89
  102. package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +104 -89
  103. package/docs-site-docusaurus/docs/api/classes/MinHeap.md +104 -89
  104. package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +104 -89
  105. package/docs-site-docusaurus/docs/api/classes/Navigator.md +5 -5
  106. package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +103 -88
  107. package/docs-site-docusaurus/docs/api/classes/Queue.md +111 -59
  108. package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +200 -212
  109. package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +10 -10
  110. package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +75 -75
  111. package/docs-site-docusaurus/docs/api/classes/SinglyLinkedListNode.md +6 -6
  112. package/docs-site-docusaurus/docs/api/classes/SkipList.md +37 -37
  113. package/docs-site-docusaurus/docs/api/classes/Stack.md +42 -42
  114. package/docs-site-docusaurus/docs/api/classes/TreeMap.md +107 -36
  115. package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +43 -43
  116. package/docs-site-docusaurus/docs/api/classes/TreeSet.md +106 -35
  117. package/docs-site-docusaurus/docs/api/classes/Trie.md +43 -43
  118. package/docs-site-docusaurus/docs/api/classes/TrieNode.md +8 -8
  119. package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +72 -72
  120. package/docs-site-docusaurus/docs/guide/architecture.md +75 -7
  121. package/docs-site-docusaurus/docs/guide/concepts.md +53 -34
  122. package/docs-site-docusaurus/docs/guide/faq.md +53 -0
  123. package/docs-site-docusaurus/docs/guide/guides.md +8 -9
  124. package/docs-site-docusaurus/docs/guide/integrations.md +74 -177
  125. package/docs-site-docusaurus/docs/guide/overview.md +131 -17
  126. package/docs-site-docusaurus/src/pages/index.tsx +4 -0
  127. package/docs-site-docusaurus/typedoc.json +1 -0
  128. package/package.json +7 -6
  129. package/src/data-structures/binary-tree/avl-tree.ts +52 -5
  130. package/src/data-structures/binary-tree/binary-indexed-tree.ts +56 -0
  131. package/src/data-structures/binary-tree/binary-tree.ts +167 -81
  132. package/src/data-structures/binary-tree/bst.ts +101 -7
  133. package/src/data-structures/binary-tree/red-black-tree.ts +82 -15
  134. package/src/data-structures/binary-tree/segment-tree.ts +24 -0
  135. package/src/data-structures/binary-tree/tree-map.ts +540 -3
  136. package/src/data-structures/binary-tree/tree-multi-map.ts +490 -2
  137. package/src/data-structures/binary-tree/tree-multi-set.ts +393 -1
  138. package/src/data-structures/binary-tree/tree-set.ts +520 -3
  139. package/src/data-structures/graph/directed-graph.ts +41 -1
  140. package/src/data-structures/graph/undirected-graph.ts +37 -1
  141. package/src/data-structures/hash/hash-map.ts +67 -12
  142. package/src/data-structures/heap/heap.ts +107 -19
  143. package/src/data-structures/linked-list/doubly-linked-list.ts +88 -0
  144. package/src/data-structures/linked-list/singly-linked-list.ts +61 -1
  145. package/src/data-structures/linked-list/skip-linked-list.ts +72 -0
  146. package/src/data-structures/matrix/matrix.ts +32 -0
  147. package/src/data-structures/queue/deque.ts +85 -0
  148. package/src/data-structures/queue/queue.ts +73 -0
  149. package/src/data-structures/stack/stack.ts +45 -5
  150. package/src/data-structures/trie/trie.ts +48 -0
  151. package/src/interfaces/binary-tree.ts +1 -9
  152. package/.vitepress/cache/deps_temp_51f5f1b0/chunk-7OIKW5WK.js +0 -12984
  153. package/.vitepress/cache/deps_temp_51f5f1b0/package.json +0 -3
  154. package/.vitepress/cache/deps_temp_51f5f1b0/vitepress___@vue_devtools-api.js +0 -4505
  155. package/.vitepress/cache/deps_temp_51f5f1b0/vitepress___@vueuse_core.js +0 -9731
  156. package/.vitepress/cache/deps_temp_51f5f1b0/vue.js +0 -347
@@ -197,6 +197,9 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
197
197
 
198
198
 
199
199
 
200
+
201
+
202
+
200
203
 
201
204
 
202
205
 
@@ -216,6 +219,29 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
216
219
  * // Length unchanged
217
220
  * console.log(deque.length); // 5;
218
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
+ */
219
245
  get first(): E | undefined;
220
246
  /**
221
247
  * Get the last element without removing it.
@@ -251,6 +277,10 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
251
277
 
252
278
 
253
279
 
280
+
281
+
282
+
283
+
254
284
 
255
285
 
256
286
 
@@ -309,6 +339,10 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
309
339
 
310
340
 
311
341
 
342
+
343
+
344
+
345
+
312
346
 
313
347
 
314
348
 
@@ -368,6 +402,10 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
368
402
 
369
403
 
370
404
 
405
+
406
+
407
+
408
+
371
409
 
372
410
 
373
411
 
@@ -414,6 +452,10 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
414
452
 
415
453
 
416
454
 
455
+
456
+
457
+
458
+
417
459
 
418
460
 
419
461
 
@@ -461,6 +503,10 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
461
503
 
462
504
 
463
505
 
506
+
507
+
508
+
509
+
464
510
 
465
511
 
466
512
 
@@ -529,6 +575,10 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
529
575
 
530
576
 
531
577
 
578
+
579
+
580
+
581
+
532
582
 
533
583
 
534
584
 
@@ -572,6 +622,10 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
572
622
 
573
623
 
574
624
 
625
+
626
+
627
+
628
+
575
629
 
576
630
 
577
631
 
@@ -616,6 +670,10 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
616
670
 
617
671
 
618
672
 
673
+
674
+
675
+
676
+
619
677
 
620
678
 
621
679
 
@@ -709,6 +767,10 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
709
767
 
710
768
 
711
769
 
770
+
771
+
772
+
773
+
712
774
 
713
775
 
714
776
 
@@ -769,6 +831,10 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
769
831
 
770
832
 
771
833
 
834
+
835
+
836
+
837
+
772
838
 
773
839
 
774
840
 
@@ -847,6 +913,10 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
847
913
 
848
914
 
849
915
 
916
+
917
+
918
+
919
+
850
920
 
851
921
 
852
922
 
@@ -894,6 +964,10 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
894
964
 
895
965
 
896
966
 
967
+
968
+
969
+
970
+
897
971
 
898
972
 
899
973
 
@@ -942,6 +1016,10 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
942
1016
 
943
1017
 
944
1018
 
1019
+
1020
+
1021
+
1022
+
945
1023
 
946
1024
 
947
1025
 
@@ -998,6 +1076,10 @@ export declare class Deque<E = any, R = any> extends LinearBase<E, R> {
998
1076
 
999
1077
 
1000
1078
 
1079
+
1080
+
1081
+
1082
+
1001
1083
 
1002
1084
 
1003
1085
 
@@ -157,6 +157,10 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
157
157
 
158
158
 
159
159
 
160
+
161
+
162
+
163
+
160
164
 
161
165
 
162
166
 
@@ -205,6 +209,10 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
205
209
 
206
210
 
207
211
 
212
+
213
+
214
+
215
+
208
216
 
209
217
 
210
218
 
@@ -217,6 +225,12 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
217
225
  * console.log(q.length); // 3;
218
226
  */
219
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;
220
234
  /**
221
235
  * Get the last element (back) without removing it.
222
236
  * @remarks Time O(1), Space O(1)
@@ -265,6 +279,10 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
265
279
 
266
280
 
267
281
 
282
+
283
+
284
+
285
+
268
286
 
269
287
 
270
288
 
@@ -325,6 +343,10 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
325
343
 
326
344
 
327
345
 
346
+
347
+
348
+
349
+
328
350
 
329
351
 
330
352
 
@@ -383,6 +405,10 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
383
405
 
384
406
 
385
407
 
408
+
409
+
410
+
411
+
386
412
 
387
413
 
388
414
 
@@ -436,6 +462,10 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
436
462
 
437
463
 
438
464
 
465
+
466
+
467
+
468
+
439
469
 
440
470
 
441
471
 
@@ -480,6 +510,10 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
480
510
 
481
511
 
482
512
 
513
+
514
+
515
+
516
+
483
517
 
484
518
 
485
519
 
@@ -515,6 +549,13 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
515
549
  * @returns True if updated.
516
550
  */
517
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;
518
559
  /**
519
560
  * Reverse the queue in-place by compacting then reversing.
520
561
  * @remarks Time O(N), Space O(N)
@@ -553,6 +594,10 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
553
594
 
554
595
 
555
596
 
597
+
598
+
599
+
600
+
556
601
 
557
602
 
558
603
 
@@ -596,6 +641,10 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
596
641
 
597
642
 
598
643
 
644
+
645
+
646
+
647
+
599
648
 
600
649
 
601
650
 
@@ -651,6 +700,10 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
651
700
 
652
701
 
653
702
 
703
+
704
+
705
+
706
+
654
707
 
655
708
 
656
709
 
@@ -699,6 +752,10 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
699
752
 
700
753
 
701
754
 
755
+
756
+
757
+
758
+
702
759
 
703
760
 
704
761
 
@@ -747,6 +804,10 @@ export declare class Queue<E = any, R = any> extends LinearBase<E, R> {
747
804
 
748
805
 
749
806
 
807
+
808
+
809
+
810
+
750
811
 
751
812
 
752
813
 
@@ -179,6 +179,10 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
179
179
 
180
180
 
181
181
 
182
+
183
+
184
+
185
+
182
186
 
183
187
 
184
188
 
@@ -235,6 +239,10 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
235
239
 
236
240
 
237
241
 
242
+
243
+
244
+
245
+
238
246
 
239
247
 
240
248
 
@@ -282,6 +290,10 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
282
290
 
283
291
 
284
292
 
293
+
294
+
295
+
296
+
285
297
 
286
298
 
287
299
 
@@ -329,6 +341,10 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
329
341
 
330
342
 
331
343
 
344
+
345
+
346
+
347
+
332
348
 
333
349
 
334
350
 
@@ -384,6 +400,10 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
384
400
 
385
401
 
386
402
 
403
+
404
+
405
+
406
+
387
407
 
388
408
 
389
409
 
@@ -448,6 +468,10 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
448
468
 
449
469
 
450
470
 
471
+
472
+
473
+
474
+
451
475
 
452
476
 
453
477
 
@@ -464,9 +488,9 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
464
488
  * Delete the element at an index.
465
489
  * @remarks Time O(N), Space O(1)
466
490
  * @param index - Zero-based index from the bottom.
467
- * @returns True if removed.
491
+ * @returns The removed element, or undefined if the index is out of range.
468
492
  */
469
- deleteAt(index: number): boolean;
493
+ deleteAt(index: number): E | undefined;
470
494
  /**
471
495
  * Delete the first element that satisfies a predicate.
472
496
  * @remarks Time O(N), Space O(1)
@@ -506,6 +530,10 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
506
530
 
507
531
 
508
532
 
533
+
534
+
535
+
536
+
509
537
 
510
538
 
511
539
 
@@ -550,6 +578,10 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
550
578
 
551
579
 
552
580
 
581
+
582
+
583
+
584
+
553
585
 
554
586
 
555
587
 
@@ -598,6 +630,10 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
598
630
 
599
631
 
600
632
 
633
+
634
+
635
+
636
+
601
637
 
602
638
 
603
639
 
@@ -654,6 +690,10 @@ export declare class Stack<E = any, R = any> extends IterableElementBase<E, R> {
654
690
 
655
691
 
656
692
 
693
+
694
+
695
+
696
+
657
697
 
658
698
 
659
699
 
@@ -248,6 +248,10 @@ export declare class Trie<R = any> extends IterableElementBase<string, R> {
248
248
 
249
249
 
250
250
 
251
+
252
+
253
+
254
+
251
255
 
252
256
 
253
257
 
@@ -302,6 +306,10 @@ export declare class Trie<R = any> extends IterableElementBase<string, R> {
302
306
 
303
307
 
304
308
 
309
+
310
+
311
+
312
+
305
313
 
306
314
 
307
315
 
@@ -351,6 +359,10 @@ export declare class Trie<R = any> extends IterableElementBase<string, R> {
351
359
 
352
360
 
353
361
 
362
+
363
+
364
+
365
+
354
366
 
355
367
 
356
368
 
@@ -396,6 +408,10 @@ export declare class Trie<R = any> extends IterableElementBase<string, R> {
396
408
 
397
409
 
398
410
 
411
+
412
+
413
+
414
+
399
415
 
400
416
 
401
417
 
@@ -440,6 +456,10 @@ export declare class Trie<R = any> extends IterableElementBase<string, R> {
440
456
 
441
457
 
442
458
 
459
+
460
+
461
+
462
+
443
463
 
444
464
 
445
465
 
@@ -487,6 +507,10 @@ export declare class Trie<R = any> extends IterableElementBase<string, R> {
487
507
 
488
508
 
489
509
 
510
+
511
+
512
+
513
+
490
514
 
491
515
 
492
516
 
@@ -559,6 +583,10 @@ export declare class Trie<R = any> extends IterableElementBase<string, R> {
559
583
 
560
584
 
561
585
 
586
+
587
+
588
+
589
+
562
590
 
563
591
 
564
592
 
@@ -614,6 +642,10 @@ export declare class Trie<R = any> extends IterableElementBase<string, R> {
614
642
 
615
643
 
616
644
 
645
+
646
+
647
+
648
+
617
649
 
618
650
 
619
651
 
@@ -663,6 +695,10 @@ export declare class Trie<R = any> extends IterableElementBase<string, R> {
663
695
 
664
696
 
665
697
 
698
+
699
+
700
+
701
+
666
702
 
667
703
 
668
704
 
@@ -712,6 +748,10 @@ export declare class Trie<R = any> extends IterableElementBase<string, R> {
712
748
 
713
749
 
714
750
 
751
+
752
+
753
+
754
+
715
755
 
716
756
 
717
757
 
@@ -758,6 +798,10 @@ export declare class Trie<R = any> extends IterableElementBase<string, R> {
758
798
 
759
799
 
760
800
 
801
+
802
+
803
+
804
+
761
805
 
762
806
 
763
807
 
@@ -799,6 +843,10 @@ export declare class Trie<R = any> extends IterableElementBase<string, R> {
799
843
 
800
844
 
801
845
 
846
+
847
+
848
+
849
+
802
850
 
803
851
 
804
852
 
@@ -1,5 +1,5 @@
1
1
  import { BinaryTreeNode } from '../data-structures';
2
- import type { BinaryTreeDeleteResult, BinaryTreeOptions, BTNRep, DFSOrderPattern, EntryCallback, IterationType, NodeCallback, NodePredicate, OptNodeOrNull, ReduceEntryCallback, ToEntryFn } from '../types';
2
+ import type { BinaryTreeOptions, BTNRep, DFSOrderPattern, EntryCallback, IterationType, NodeCallback, NodePredicate, OptNodeOrNull, ReduceEntryCallback, ToEntryFn } from '../types';
3
3
  /**
4
4
  * Public, implementation-agnostic binary tree API.
5
5
  * K = key, V = value, R = raw/record used with toEntryFn (optional).
@@ -19,7 +19,7 @@ export interface IBinaryTree<K = any, V = any, R = any> {
19
19
  add(keyOrNodeOrEntryOrRawElement: BTNRep<K, V, BinaryTreeNode<K, V>>, value?: V, count?: number): boolean;
20
20
  set(keyOrNodeOrEntryOrRawElement: BTNRep<K, V, BinaryTreeNode<K, V>>, value?: V, count?: number): boolean;
21
21
  addMany(keysNodesEntriesOrRaws: Iterable<K | BinaryTreeNode<K, V> | [K | null | undefined, V | undefined] | null | undefined | R>, values?: Iterable<V | undefined>): boolean[];
22
- delete(keyNodeEntryRawOrPredicate: BTNRep<K, V, BinaryTreeNode<K, V>> | NodePredicate<BinaryTreeNode<K, V> | null>): BinaryTreeDeleteResult<BinaryTreeNode<K, V>>[];
22
+ delete(keyNodeEntryRawOrPredicate: BTNRep<K, V, BinaryTreeNode<K, V>> | NodePredicate<BinaryTreeNode<K, V> | null>): boolean;
23
23
  clear(): void;
24
24
  isEmpty(): boolean;
25
25
  get(keyNodeEntryOrPredicate: K | BinaryTreeNode<K, V> | [K | null | undefined, V | undefined] | null | undefined, startNode?: K | BinaryTreeNode<K, V> | [K | null | undefined, V | undefined] | null | undefined, iterationType?: IterationType): V | undefined;
@@ -56,5 +56,4 @@ export interface IBinaryTree<K = any, V = any, R = any> {
56
56
  filter(predicate: EntryCallback<K, V | undefined, boolean>, thisArg?: unknown): this;
57
57
  map<MK = K, MV = V, MR = any>(callback: EntryCallback<K, V | undefined, [MK, MV]>, options?: Partial<BinaryTreeOptions<MK, MV, MR>>, thisArg?: unknown): IBinaryTree<MK, MV, MR>;
58
58
  merge(anotherTree: IBinaryTree<K, V, R>): void;
59
- refill(keysNodesEntriesOrRaws: Iterable<K | BinaryTreeNode<K, V> | [K | null | undefined, V | undefined] | null | undefined | R>, values?: Iterable<V | undefined>): void;
60
59
  }