max-priority-queue-typed 2.5.2 → 2.6.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/dist/cjs/index.cjs +174 -16
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs-legacy/index.cjs +174 -16
- package/dist/cjs-legacy/index.cjs.map +1 -1
- package/dist/esm/index.mjs +174 -16
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm-legacy/index.mjs +174 -16
- package/dist/esm-legacy/index.mjs.map +1 -1
- package/dist/types/data-structures/base/iterable-element-base.d.ts +17 -0
- package/dist/types/data-structures/base/linear-base.d.ts +6 -0
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +86 -2
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +98 -0
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +191 -15
- package/dist/types/data-structures/binary-tree/bst.d.ts +171 -3
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +136 -8
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +42 -0
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +1061 -167
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +1232 -355
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +916 -194
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +1078 -141
- package/dist/types/data-structures/graph/directed-graph.d.ts +70 -0
- package/dist/types/data-structures/graph/undirected-graph.d.ts +63 -0
- package/dist/types/data-structures/hash/hash-map.d.ts +84 -6
- package/dist/types/data-structures/heap/heap.d.ts +140 -12
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +150 -2
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +106 -1
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +126 -0
- package/dist/types/data-structures/matrix/matrix.d.ts +56 -0
- package/dist/types/data-structures/queue/deque.d.ts +171 -0
- package/dist/types/data-structures/queue/queue.d.ts +97 -0
- package/dist/types/data-structures/stack/stack.d.ts +72 -2
- package/dist/types/data-structures/trie/trie.d.ts +84 -0
- package/dist/types/interfaces/binary-tree.d.ts +2 -3
- package/dist/umd/max-priority-queue-typed.js +174 -16
- package/dist/umd/max-priority-queue-typed.js.map +1 -1
- package/dist/umd/max-priority-queue-typed.min.js +1 -1
- package/dist/umd/max-priority-queue-typed.min.js.map +1 -1
- package/package.json +2 -2
- package/src/data-structures/base/iterable-element-base.ts +32 -0
- package/src/data-structures/base/linear-base.ts +11 -0
- package/src/data-structures/binary-tree/avl-tree.ts +88 -5
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +98 -0
- package/src/data-structures/binary-tree/binary-tree.ts +242 -81
- package/src/data-structures/binary-tree/bst.ts +173 -7
- package/src/data-structures/binary-tree/red-black-tree.ts +139 -15
- package/src/data-structures/binary-tree/segment-tree.ts +42 -0
- package/src/data-structures/binary-tree/tree-map.ts +948 -36
- package/src/data-structures/binary-tree/tree-multi-map.ts +893 -13
- package/src/data-structures/binary-tree/tree-multi-set.ts +761 -33
- package/src/data-structures/binary-tree/tree-set.ts +1260 -251
- package/src/data-structures/graph/directed-graph.ts +71 -1
- package/src/data-structures/graph/undirected-graph.ts +64 -1
- package/src/data-structures/hash/hash-map.ts +100 -12
- package/src/data-structures/heap/heap.ts +149 -19
- package/src/data-structures/linked-list/doubly-linked-list.ts +178 -2
- package/src/data-structures/linked-list/singly-linked-list.ts +106 -1
- package/src/data-structures/linked-list/skip-linked-list.ts +126 -0
- package/src/data-structures/matrix/matrix.ts +56 -0
- package/src/data-structures/queue/deque.ts +187 -0
- package/src/data-structures/queue/queue.ts +109 -0
- package/src/data-structures/stack/stack.ts +75 -5
- package/src/data-structures/trie/trie.ts +84 -0
- package/src/interfaces/binary-tree.ts +1 -9
|
@@ -311,6 +311,13 @@ export class Trie<R = any> extends IterableElementBase<string, R> {
|
|
|
311
311
|
|
|
312
312
|
|
|
313
313
|
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
|
|
314
321
|
|
|
315
322
|
|
|
316
323
|
|
|
@@ -385,6 +392,13 @@ export class Trie<R = any> extends IterableElementBase<string, R> {
|
|
|
385
392
|
|
|
386
393
|
|
|
387
394
|
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
388
402
|
|
|
389
403
|
|
|
390
404
|
|
|
@@ -446,6 +460,13 @@ export class Trie<R = any> extends IterableElementBase<string, R> {
|
|
|
446
460
|
|
|
447
461
|
|
|
448
462
|
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
|
|
449
470
|
|
|
450
471
|
|
|
451
472
|
|
|
@@ -502,6 +523,13 @@ export class Trie<R = any> extends IterableElementBase<string, R> {
|
|
|
502
523
|
|
|
503
524
|
|
|
504
525
|
|
|
526
|
+
|
|
527
|
+
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
|
|
505
533
|
|
|
506
534
|
|
|
507
535
|
|
|
@@ -550,6 +578,13 @@ export class Trie<R = any> extends IterableElementBase<string, R> {
|
|
|
550
578
|
|
|
551
579
|
|
|
552
580
|
|
|
581
|
+
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
|
|
553
588
|
|
|
554
589
|
|
|
555
590
|
|
|
@@ -602,6 +637,13 @@ export class Trie<R = any> extends IterableElementBase<string, R> {
|
|
|
602
637
|
|
|
603
638
|
|
|
604
639
|
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
|
|
645
|
+
|
|
646
|
+
|
|
605
647
|
|
|
606
648
|
|
|
607
649
|
|
|
@@ -741,6 +783,13 @@ export class Trie<R = any> extends IterableElementBase<string, R> {
|
|
|
741
783
|
|
|
742
784
|
|
|
743
785
|
|
|
786
|
+
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
|
|
790
|
+
|
|
791
|
+
|
|
792
|
+
|
|
744
793
|
|
|
745
794
|
|
|
746
795
|
|
|
@@ -821,6 +870,13 @@ export class Trie<R = any> extends IterableElementBase<string, R> {
|
|
|
821
870
|
|
|
822
871
|
|
|
823
872
|
|
|
873
|
+
|
|
874
|
+
|
|
875
|
+
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
|
|
879
|
+
|
|
824
880
|
|
|
825
881
|
|
|
826
882
|
|
|
@@ -882,6 +938,13 @@ export class Trie<R = any> extends IterableElementBase<string, R> {
|
|
|
882
938
|
|
|
883
939
|
|
|
884
940
|
|
|
941
|
+
|
|
942
|
+
|
|
943
|
+
|
|
944
|
+
|
|
945
|
+
|
|
946
|
+
|
|
947
|
+
|
|
885
948
|
|
|
886
949
|
|
|
887
950
|
|
|
@@ -966,6 +1029,13 @@ export class Trie<R = any> extends IterableElementBase<string, R> {
|
|
|
966
1029
|
|
|
967
1030
|
|
|
968
1031
|
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
|
|
1035
|
+
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
|
|
969
1039
|
|
|
970
1040
|
|
|
971
1041
|
|
|
@@ -1018,6 +1088,13 @@ export class Trie<R = any> extends IterableElementBase<string, R> {
|
|
|
1018
1088
|
|
|
1019
1089
|
|
|
1020
1090
|
|
|
1091
|
+
|
|
1092
|
+
|
|
1093
|
+
|
|
1094
|
+
|
|
1095
|
+
|
|
1096
|
+
|
|
1097
|
+
|
|
1021
1098
|
|
|
1022
1099
|
|
|
1023
1100
|
|
|
@@ -1071,6 +1148,13 @@ export class Trie<R = any> extends IterableElementBase<string, R> {
|
|
|
1071
1148
|
|
|
1072
1149
|
|
|
1073
1150
|
|
|
1151
|
+
|
|
1152
|
+
|
|
1153
|
+
|
|
1154
|
+
|
|
1155
|
+
|
|
1156
|
+
|
|
1157
|
+
|
|
1074
1158
|
|
|
1075
1159
|
|
|
1076
1160
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BinaryTreeNode } from '../data-structures';
|
|
2
2
|
import type {
|
|
3
|
-
BinaryTreeDeleteResult,
|
|
4
3
|
BinaryTreeOptions,
|
|
5
4
|
BTNRep,
|
|
6
5
|
DFSOrderPattern,
|
|
@@ -51,7 +50,7 @@ export interface IBinaryTree<K = any, V = any, R = any> {
|
|
|
51
50
|
// Accept BTNRep, predicate, or raw R for deletion
|
|
52
51
|
delete(
|
|
53
52
|
keyNodeEntryRawOrPredicate: BTNRep<K, V, BinaryTreeNode<K, V>> | NodePredicate<BinaryTreeNode<K, V> | null>
|
|
54
|
-
):
|
|
53
|
+
): boolean;
|
|
55
54
|
|
|
56
55
|
clear(): void;
|
|
57
56
|
|
|
@@ -242,11 +241,4 @@ export interface IBinaryTree<K = any, V = any, R = any> {
|
|
|
242
241
|
|
|
243
242
|
// ---- bulk / interop ----
|
|
244
243
|
merge(anotherTree: IBinaryTree<K, V, R>): void;
|
|
245
|
-
|
|
246
|
-
refill(
|
|
247
|
-
keysNodesEntriesOrRaws: Iterable<
|
|
248
|
-
K | BinaryTreeNode<K, V> | [K | null | undefined, V | undefined] | null | undefined | R
|
|
249
|
-
>,
|
|
250
|
-
values?: Iterable<V | undefined>
|
|
251
|
-
): void;
|
|
252
244
|
}
|