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
|
@@ -509,6 +509,12 @@ export class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R> implemen
|
|
|
509
509
|
|
|
510
510
|
|
|
511
511
|
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
|
|
512
518
|
|
|
513
519
|
|
|
514
520
|
|
|
@@ -619,6 +625,12 @@ export class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R> implemen
|
|
|
619
625
|
|
|
620
626
|
|
|
621
627
|
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
|
|
632
|
+
|
|
633
|
+
|
|
622
634
|
|
|
623
635
|
|
|
624
636
|
|
|
@@ -725,6 +737,12 @@ export class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R> implemen
|
|
|
725
737
|
|
|
726
738
|
|
|
727
739
|
|
|
740
|
+
|
|
741
|
+
|
|
742
|
+
|
|
743
|
+
|
|
744
|
+
|
|
745
|
+
|
|
728
746
|
|
|
729
747
|
|
|
730
748
|
|
|
@@ -843,6 +861,12 @@ export class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R> implemen
|
|
|
843
861
|
|
|
844
862
|
|
|
845
863
|
|
|
864
|
+
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
|
|
846
870
|
|
|
847
871
|
|
|
848
872
|
|
|
@@ -980,6 +1004,12 @@ export class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R> implemen
|
|
|
980
1004
|
|
|
981
1005
|
|
|
982
1006
|
|
|
1007
|
+
|
|
1008
|
+
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
|
|
983
1013
|
|
|
984
1014
|
|
|
985
1015
|
|
|
@@ -1182,6 +1212,9 @@ export class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R> implemen
|
|
|
1182
1212
|
|
|
1183
1213
|
|
|
1184
1214
|
|
|
1215
|
+
|
|
1216
|
+
|
|
1217
|
+
|
|
1185
1218
|
|
|
1186
1219
|
|
|
1187
1220
|
|
|
@@ -1553,6 +1586,15 @@ export class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R> implemen
|
|
|
1553
1586
|
|
|
1554
1587
|
|
|
1555
1588
|
|
|
1589
|
+
|
|
1590
|
+
|
|
1591
|
+
|
|
1592
|
+
|
|
1593
|
+
|
|
1594
|
+
|
|
1595
|
+
|
|
1596
|
+
|
|
1597
|
+
|
|
1556
1598
|
|
|
1557
1599
|
|
|
1558
1600
|
|
|
@@ -1689,6 +1731,12 @@ export class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R> implemen
|
|
|
1689
1731
|
|
|
1690
1732
|
|
|
1691
1733
|
|
|
1734
|
+
|
|
1735
|
+
|
|
1736
|
+
|
|
1737
|
+
|
|
1738
|
+
|
|
1739
|
+
|
|
1692
1740
|
|
|
1693
1741
|
|
|
1694
1742
|
|
|
@@ -1835,6 +1883,9 @@ export class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R> implemen
|
|
|
1835
1883
|
|
|
1836
1884
|
|
|
1837
1885
|
|
|
1886
|
+
|
|
1887
|
+
|
|
1888
|
+
|
|
1838
1889
|
|
|
1839
1890
|
|
|
1840
1891
|
|
|
@@ -1945,6 +1996,9 @@ export class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R> implemen
|
|
|
1945
1996
|
|
|
1946
1997
|
|
|
1947
1998
|
|
|
1999
|
+
|
|
2000
|
+
|
|
2001
|
+
|
|
1948
2002
|
|
|
1949
2003
|
|
|
1950
2004
|
|
|
@@ -2054,6 +2108,9 @@ export class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R> implemen
|
|
|
2054
2108
|
|
|
2055
2109
|
|
|
2056
2110
|
|
|
2111
|
+
|
|
2112
|
+
|
|
2113
|
+
|
|
2057
2114
|
|
|
2058
2115
|
|
|
2059
2116
|
|
|
@@ -2207,6 +2264,9 @@ export class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R> implemen
|
|
|
2207
2264
|
|
|
2208
2265
|
|
|
2209
2266
|
|
|
2267
|
+
|
|
2268
|
+
|
|
2269
|
+
|
|
2210
2270
|
|
|
2211
2271
|
|
|
2212
2272
|
|
|
@@ -2416,6 +2476,9 @@ export class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R> implemen
|
|
|
2416
2476
|
|
|
2417
2477
|
|
|
2418
2478
|
|
|
2479
|
+
|
|
2480
|
+
|
|
2481
|
+
|
|
2419
2482
|
|
|
2420
2483
|
|
|
2421
2484
|
|
|
@@ -2493,6 +2556,9 @@ export class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R> implemen
|
|
|
2493
2556
|
|
|
2494
2557
|
|
|
2495
2558
|
|
|
2559
|
+
|
|
2560
|
+
|
|
2561
|
+
|
|
2496
2562
|
|
|
2497
2563
|
|
|
2498
2564
|
|
|
@@ -2626,6 +2692,12 @@ export class BST<K = any, V = any, R = any> extends BinaryTree<K, V, R> implemen
|
|
|
2626
2692
|
|
|
2627
2693
|
|
|
2628
2694
|
|
|
2695
|
+
|
|
2696
|
+
|
|
2697
|
+
|
|
2698
|
+
|
|
2699
|
+
|
|
2700
|
+
|
|
2629
2701
|
|
|
2630
2702
|
|
|
2631
2703
|
|
|
@@ -468,6 +468,18 @@ export class RedBlackTree<K = any, V = any, R = any> extends BST<K, V, R> implem
|
|
|
468
468
|
|
|
469
469
|
|
|
470
470
|
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
|
|
471
483
|
|
|
472
484
|
|
|
473
485
|
|
|
@@ -1016,6 +1028,18 @@ export class RedBlackTree<K = any, V = any, R = any> extends BST<K, V, R> implem
|
|
|
1016
1028
|
|
|
1017
1029
|
|
|
1018
1030
|
|
|
1031
|
+
|
|
1032
|
+
|
|
1033
|
+
|
|
1034
|
+
|
|
1035
|
+
|
|
1036
|
+
|
|
1037
|
+
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
|
|
1041
|
+
|
|
1042
|
+
|
|
1019
1043
|
|
|
1020
1044
|
|
|
1021
1045
|
|
|
@@ -1244,6 +1268,18 @@ export class RedBlackTree<K = any, V = any, R = any> extends BST<K, V, R> implem
|
|
|
1244
1268
|
|
|
1245
1269
|
|
|
1246
1270
|
|
|
1271
|
+
|
|
1272
|
+
|
|
1273
|
+
|
|
1274
|
+
|
|
1275
|
+
|
|
1276
|
+
|
|
1277
|
+
|
|
1278
|
+
|
|
1279
|
+
|
|
1280
|
+
|
|
1281
|
+
|
|
1282
|
+
|
|
1247
1283
|
|
|
1248
1284
|
|
|
1249
1285
|
|
|
@@ -1464,6 +1500,15 @@ export class RedBlackTree<K = any, V = any, R = any> extends BST<K, V, R> implem
|
|
|
1464
1500
|
|
|
1465
1501
|
|
|
1466
1502
|
|
|
1503
|
+
|
|
1504
|
+
|
|
1505
|
+
|
|
1506
|
+
|
|
1507
|
+
|
|
1508
|
+
|
|
1509
|
+
|
|
1510
|
+
|
|
1511
|
+
|
|
1467
1512
|
|
|
1468
1513
|
|
|
1469
1514
|
|
|
@@ -1630,6 +1675,18 @@ export class RedBlackTree<K = any, V = any, R = any> extends BST<K, V, R> implem
|
|
|
1630
1675
|
|
|
1631
1676
|
|
|
1632
1677
|
|
|
1678
|
+
|
|
1679
|
+
|
|
1680
|
+
|
|
1681
|
+
|
|
1682
|
+
|
|
1683
|
+
|
|
1684
|
+
|
|
1685
|
+
|
|
1686
|
+
|
|
1687
|
+
|
|
1688
|
+
|
|
1689
|
+
|
|
1633
1690
|
|
|
1634
1691
|
|
|
1635
1692
|
|
|
@@ -113,6 +113,9 @@ export class SegmentTree<E = number> implements Iterable<E> {
|
|
|
113
113
|
|
|
114
114
|
|
|
115
115
|
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
116
119
|
|
|
117
120
|
|
|
118
121
|
|
|
@@ -192,6 +195,9 @@ export class SegmentTree<E = number> implements Iterable<E> {
|
|
|
192
195
|
|
|
193
196
|
|
|
194
197
|
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
195
201
|
|
|
196
202
|
|
|
197
203
|
|
|
@@ -266,6 +272,9 @@ export class SegmentTree<E = number> implements Iterable<E> {
|
|
|
266
272
|
|
|
267
273
|
|
|
268
274
|
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
269
278
|
|
|
270
279
|
|
|
271
280
|
|
|
@@ -347,6 +356,9 @@ export class SegmentTree<E = number> implements Iterable<E> {
|
|
|
347
356
|
|
|
348
357
|
|
|
349
358
|
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
350
362
|
|
|
351
363
|
|
|
352
364
|
|
|
@@ -404,6 +416,9 @@ export class SegmentTree<E = number> implements Iterable<E> {
|
|
|
404
416
|
|
|
405
417
|
|
|
406
418
|
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
407
422
|
|
|
408
423
|
|
|
409
424
|
|
|
@@ -500,6 +515,9 @@ export class SegmentTree<E = number> implements Iterable<E> {
|
|
|
500
515
|
|
|
501
516
|
|
|
502
517
|
|
|
518
|
+
|
|
519
|
+
|
|
520
|
+
|
|
503
521
|
|
|
504
522
|
|
|
505
523
|
|