data-structure-typed 2.5.3 → 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/.husky/pre-commit +3 -0
- package/CHANGELOG.md +1 -1
- package/MIGRATION.md +48 -0
- package/README.md +20 -2
- package/README_CN.md +20 -2
- package/SPECIFICATION.md +24 -0
- package/SPECIFICATION.zh-CN.md +24 -0
- package/dist/cjs/binary-tree.cjs +1897 -19
- package/dist/cjs/graph.cjs +174 -0
- package/dist/cjs/hash.cjs +33 -0
- package/dist/cjs/heap.cjs +71 -0
- package/dist/cjs/index.cjs +2383 -3
- package/dist/cjs/linked-list.cjs +224 -2
- package/dist/cjs/matrix.cjs +24 -0
- package/dist/cjs/priority-queue.cjs +71 -0
- package/dist/cjs/queue.cjs +221 -1
- package/dist/cjs/stack.cjs +59 -0
- package/dist/cjs/trie.cjs +62 -0
- package/dist/cjs-legacy/binary-tree.cjs +1897 -19
- package/dist/cjs-legacy/graph.cjs +174 -0
- package/dist/cjs-legacy/hash.cjs +33 -0
- package/dist/cjs-legacy/heap.cjs +71 -0
- package/dist/cjs-legacy/index.cjs +2383 -3
- package/dist/cjs-legacy/linked-list.cjs +224 -2
- package/dist/cjs-legacy/matrix.cjs +24 -0
- package/dist/cjs-legacy/priority-queue.cjs +71 -0
- package/dist/cjs-legacy/queue.cjs +221 -1
- package/dist/cjs-legacy/stack.cjs +59 -0
- package/dist/cjs-legacy/trie.cjs +62 -0
- package/dist/esm/binary-tree.mjs +1897 -19
- package/dist/esm/graph.mjs +174 -0
- package/dist/esm/hash.mjs +33 -0
- package/dist/esm/heap.mjs +71 -0
- package/dist/esm/index.mjs +2383 -3
- package/dist/esm/linked-list.mjs +224 -2
- package/dist/esm/matrix.mjs +24 -0
- package/dist/esm/priority-queue.mjs +71 -0
- package/dist/esm/queue.mjs +221 -1
- package/dist/esm/stack.mjs +59 -0
- package/dist/esm/trie.mjs +62 -0
- package/dist/esm-legacy/binary-tree.mjs +1897 -19
- package/dist/esm-legacy/graph.mjs +174 -0
- package/dist/esm-legacy/hash.mjs +33 -0
- package/dist/esm-legacy/heap.mjs +71 -0
- package/dist/esm-legacy/index.mjs +2383 -3
- package/dist/esm-legacy/linked-list.mjs +224 -2
- package/dist/esm-legacy/matrix.mjs +24 -0
- package/dist/esm-legacy/priority-queue.mjs +71 -0
- package/dist/esm-legacy/queue.mjs +221 -1
- package/dist/esm-legacy/stack.mjs +59 -0
- package/dist/esm-legacy/trie.mjs +62 -0
- 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 +36 -0
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +42 -0
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +75 -0
- package/dist/types/data-structures/binary-tree/bst.d.ts +72 -0
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +57 -0
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +18 -0
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +375 -0
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +389 -0
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +330 -0
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +438 -0
- package/dist/types/data-structures/graph/directed-graph.d.ts +30 -0
- package/dist/types/data-structures/graph/undirected-graph.d.ts +27 -0
- package/dist/types/data-structures/hash/hash-map.d.ts +33 -0
- package/dist/types/data-structures/heap/heap.d.ts +42 -0
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +75 -2
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +45 -0
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +54 -0
- package/dist/types/data-structures/matrix/matrix.d.ts +24 -0
- package/dist/types/data-structures/queue/deque.d.ts +90 -1
- package/dist/types/data-structures/queue/queue.d.ts +36 -0
- package/dist/types/data-structures/stack/stack.d.ts +30 -0
- package/dist/types/data-structures/trie/trie.d.ts +36 -0
- package/dist/umd/data-structure-typed.js +2383 -3
- package/dist/umd/data-structure-typed.min.js +3 -3
- package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +14 -10
- package/jest.integration.config.js +1 -2
- package/package.json +9 -7
- 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 +36 -0
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +42 -0
- package/src/data-structures/binary-tree/binary-tree.ts +75 -0
- package/src/data-structures/binary-tree/bst.ts +72 -0
- package/src/data-structures/binary-tree/red-black-tree.ts +57 -0
- package/src/data-structures/binary-tree/segment-tree.ts +18 -0
- package/src/data-structures/binary-tree/tree-map.ts +375 -0
- package/src/data-structures/binary-tree/tree-multi-map.ts +392 -0
- package/src/data-structures/binary-tree/tree-multi-set.ts +336 -0
- package/src/data-structures/binary-tree/tree-set.ts +492 -0
- package/src/data-structures/graph/directed-graph.ts +30 -0
- package/src/data-structures/graph/undirected-graph.ts +27 -0
- package/src/data-structures/hash/hash-map.ts +33 -0
- package/src/data-structures/heap/heap.ts +42 -0
- package/src/data-structures/linked-list/doubly-linked-list.ts +90 -2
- package/src/data-structures/linked-list/singly-linked-list.ts +45 -0
- package/src/data-structures/linked-list/skip-linked-list.ts +54 -0
- package/src/data-structures/matrix/matrix.ts +24 -0
- package/src/data-structures/queue/deque.ts +103 -1
- package/src/data-structures/queue/queue.ts +36 -0
- package/src/data-structures/stack/stack.ts +30 -0
- package/src/data-structures/trie/trie.ts +36 -0
|
@@ -382,6 +382,12 @@ export declare class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R>
|
|
|
382
382
|
|
|
383
383
|
|
|
384
384
|
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
|
|
385
391
|
|
|
386
392
|
|
|
387
393
|
|
|
@@ -462,6 +468,12 @@ export declare class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R>
|
|
|
462
468
|
|
|
463
469
|
|
|
464
470
|
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
465
477
|
|
|
466
478
|
|
|
467
479
|
|
|
@@ -545,6 +557,12 @@ export declare class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R>
|
|
|
545
557
|
|
|
546
558
|
|
|
547
559
|
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
|
|
548
566
|
|
|
549
567
|
|
|
550
568
|
|
|
@@ -639,6 +657,12 @@ export declare class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R>
|
|
|
639
657
|
|
|
640
658
|
|
|
641
659
|
|
|
660
|
+
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
|
|
665
|
+
|
|
642
666
|
|
|
643
667
|
|
|
644
668
|
|
|
@@ -717,6 +741,12 @@ export declare class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R>
|
|
|
717
741
|
|
|
718
742
|
|
|
719
743
|
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
|
|
748
|
+
|
|
749
|
+
|
|
720
750
|
|
|
721
751
|
|
|
722
752
|
|
|
@@ -769,6 +799,9 @@ export declare class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R>
|
|
|
769
799
|
|
|
770
800
|
|
|
771
801
|
|
|
802
|
+
|
|
803
|
+
|
|
804
|
+
|
|
772
805
|
|
|
773
806
|
|
|
774
807
|
|
|
@@ -949,6 +982,15 @@ export declare class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R>
|
|
|
949
982
|
|
|
950
983
|
|
|
951
984
|
|
|
985
|
+
|
|
986
|
+
|
|
987
|
+
|
|
988
|
+
|
|
989
|
+
|
|
990
|
+
|
|
991
|
+
|
|
992
|
+
|
|
993
|
+
|
|
952
994
|
|
|
953
995
|
|
|
954
996
|
|
|
@@ -1038,6 +1080,12 @@ export declare class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R>
|
|
|
1038
1080
|
|
|
1039
1081
|
|
|
1040
1082
|
|
|
1083
|
+
|
|
1084
|
+
|
|
1085
|
+
|
|
1086
|
+
|
|
1087
|
+
|
|
1088
|
+
|
|
1041
1089
|
|
|
1042
1090
|
|
|
1043
1091
|
|
|
@@ -1093,6 +1141,9 @@ export declare class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R>
|
|
|
1093
1141
|
|
|
1094
1142
|
|
|
1095
1143
|
|
|
1144
|
+
|
|
1145
|
+
|
|
1146
|
+
|
|
1096
1147
|
|
|
1097
1148
|
|
|
1098
1149
|
|
|
@@ -1151,6 +1202,9 @@ export declare class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R>
|
|
|
1151
1202
|
|
|
1152
1203
|
|
|
1153
1204
|
|
|
1205
|
+
|
|
1206
|
+
|
|
1207
|
+
|
|
1154
1208
|
|
|
1155
1209
|
|
|
1156
1210
|
|
|
@@ -1208,6 +1262,9 @@ export declare class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R>
|
|
|
1208
1262
|
|
|
1209
1263
|
|
|
1210
1264
|
|
|
1265
|
+
|
|
1266
|
+
|
|
1267
|
+
|
|
1211
1268
|
|
|
1212
1269
|
|
|
1213
1270
|
|
|
@@ -1266,6 +1323,9 @@ export declare class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R>
|
|
|
1266
1323
|
|
|
1267
1324
|
|
|
1268
1325
|
|
|
1326
|
+
|
|
1327
|
+
|
|
1328
|
+
|
|
1269
1329
|
|
|
1270
1330
|
|
|
1271
1331
|
|
|
@@ -1324,6 +1384,9 @@ export declare class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R>
|
|
|
1324
1384
|
|
|
1325
1385
|
|
|
1326
1386
|
|
|
1387
|
+
|
|
1388
|
+
|
|
1389
|
+
|
|
1327
1390
|
|
|
1328
1391
|
|
|
1329
1392
|
|
|
@@ -1377,6 +1440,9 @@ export declare class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R>
|
|
|
1377
1440
|
|
|
1378
1441
|
|
|
1379
1442
|
|
|
1443
|
+
|
|
1444
|
+
|
|
1445
|
+
|
|
1380
1446
|
|
|
1381
1447
|
|
|
1382
1448
|
|
|
@@ -1467,6 +1533,12 @@ export declare class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R>
|
|
|
1467
1533
|
|
|
1468
1534
|
|
|
1469
1535
|
|
|
1536
|
+
|
|
1537
|
+
|
|
1538
|
+
|
|
1539
|
+
|
|
1540
|
+
|
|
1541
|
+
|
|
1470
1542
|
|
|
1471
1543
|
|
|
1472
1544
|
|
|
@@ -353,6 +353,18 @@ export declare class RedBlackTree<K = any, V = any, R = any> extends BST<K, V, R
|
|
|
353
353
|
|
|
354
354
|
|
|
355
355
|
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
|
|
366
|
+
|
|
367
|
+
|
|
356
368
|
|
|
357
369
|
|
|
358
370
|
|
|
@@ -607,6 +619,18 @@ export declare class RedBlackTree<K = any, V = any, R = any> extends BST<K, V, R
|
|
|
607
619
|
|
|
608
620
|
|
|
609
621
|
|
|
622
|
+
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
|
|
610
634
|
|
|
611
635
|
|
|
612
636
|
|
|
@@ -781,6 +805,18 @@ export declare class RedBlackTree<K = any, V = any, R = any> extends BST<K, V, R
|
|
|
781
805
|
|
|
782
806
|
|
|
783
807
|
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
|
|
811
|
+
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
|
|
816
|
+
|
|
817
|
+
|
|
818
|
+
|
|
819
|
+
|
|
784
820
|
|
|
785
821
|
|
|
786
822
|
|
|
@@ -916,6 +952,15 @@ export declare class RedBlackTree<K = any, V = any, R = any> extends BST<K, V, R
|
|
|
916
952
|
|
|
917
953
|
|
|
918
954
|
|
|
955
|
+
|
|
956
|
+
|
|
957
|
+
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
|
|
962
|
+
|
|
963
|
+
|
|
919
964
|
|
|
920
965
|
|
|
921
966
|
|
|
@@ -1069,6 +1114,18 @@ export declare class RedBlackTree<K = any, V = any, R = any> extends BST<K, V, R
|
|
|
1069
1114
|
|
|
1070
1115
|
|
|
1071
1116
|
|
|
1117
|
+
|
|
1118
|
+
|
|
1119
|
+
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
|
|
1123
|
+
|
|
1124
|
+
|
|
1125
|
+
|
|
1126
|
+
|
|
1127
|
+
|
|
1128
|
+
|
|
1072
1129
|
|
|
1073
1130
|
|
|
1074
1131
|
|
|
@@ -80,6 +80,9 @@ export declare class SegmentTree<E = number> implements Iterable<E> {
|
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
83
86
|
|
|
84
87
|
|
|
85
88
|
|
|
@@ -145,6 +148,9 @@ export declare class SegmentTree<E = number> implements Iterable<E> {
|
|
|
145
148
|
|
|
146
149
|
|
|
147
150
|
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
148
154
|
|
|
149
155
|
|
|
150
156
|
|
|
@@ -206,6 +212,9 @@ export declare class SegmentTree<E = number> implements Iterable<E> {
|
|
|
206
212
|
|
|
207
213
|
|
|
208
214
|
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
209
218
|
|
|
210
219
|
|
|
211
220
|
|
|
@@ -262,6 +271,9 @@ export declare class SegmentTree<E = number> implements Iterable<E> {
|
|
|
262
271
|
|
|
263
272
|
|
|
264
273
|
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
265
277
|
|
|
266
278
|
|
|
267
279
|
|
|
@@ -313,6 +325,9 @@ export declare class SegmentTree<E = number> implements Iterable<E> {
|
|
|
313
325
|
|
|
314
326
|
|
|
315
327
|
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
316
331
|
|
|
317
332
|
|
|
318
333
|
|
|
@@ -367,6 +382,9 @@ export declare class SegmentTree<E = number> implements Iterable<E> {
|
|
|
367
382
|
|
|
368
383
|
|
|
369
384
|
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
370
388
|
|
|
371
389
|
|
|
372
390
|
|