max-priority-queue-typed 2.5.0 → 2.5.1

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 (74) hide show
  1. package/dist/cjs/index.cjs +294 -0
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/cjs-legacy/index.cjs +294 -0
  4. package/dist/cjs-legacy/index.cjs.map +1 -1
  5. package/dist/esm/index.mjs +294 -0
  6. package/dist/esm/index.mjs.map +1 -1
  7. package/dist/esm-legacy/index.mjs +294 -0
  8. package/dist/esm-legacy/index.mjs.map +1 -1
  9. package/dist/types/data-structures/base/index.d.ts +1 -0
  10. package/dist/types/data-structures/base/iterable-entry-base.d.ts +8 -8
  11. package/dist/types/data-structures/base/linear-base.d.ts +3 -3
  12. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +252 -0
  13. package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +294 -0
  14. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +527 -2
  15. package/dist/types/data-structures/binary-tree/bst.d.ts +505 -1
  16. package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +399 -0
  17. package/dist/types/data-structures/binary-tree/segment-tree.d.ts +126 -1
  18. package/dist/types/data-structures/binary-tree/tree-map.d.ts +2881 -382
  19. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +2867 -347
  20. package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +2328 -312
  21. package/dist/types/data-structures/binary-tree/tree-set.d.ts +2671 -277
  22. package/dist/types/data-structures/graph/abstract-graph.d.ts +4 -4
  23. package/dist/types/data-structures/graph/directed-graph.d.ts +210 -0
  24. package/dist/types/data-structures/graph/undirected-graph.d.ts +189 -0
  25. package/dist/types/data-structures/hash/hash-map.d.ts +241 -10
  26. package/dist/types/data-structures/heap/heap.d.ts +294 -0
  27. package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +360 -3
  28. package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +318 -3
  29. package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +380 -2
  30. package/dist/types/data-structures/matrix/matrix.d.ts +168 -0
  31. package/dist/types/data-structures/queue/deque.d.ts +319 -4
  32. package/dist/types/data-structures/queue/queue.d.ts +252 -0
  33. package/dist/types/data-structures/stack/stack.d.ts +210 -0
  34. package/dist/types/data-structures/trie/trie.d.ts +256 -4
  35. package/dist/types/interfaces/graph.d.ts +1 -1
  36. package/dist/types/types/common.d.ts +2 -2
  37. package/dist/types/types/data-structures/heap/heap.d.ts +1 -0
  38. package/dist/types/types/data-structures/priority-queue/priority-queue.d.ts +1 -0
  39. package/dist/types/types/utils/validate-type.d.ts +4 -4
  40. package/dist/umd/max-priority-queue-typed.js +294 -0
  41. package/dist/umd/max-priority-queue-typed.js.map +1 -1
  42. package/dist/umd/max-priority-queue-typed.min.js.map +1 -1
  43. package/package.json +2 -2
  44. package/src/data-structures/base/index.ts +1 -0
  45. package/src/data-structures/base/iterable-entry-base.ts +8 -8
  46. package/src/data-structures/base/linear-base.ts +3 -3
  47. package/src/data-structures/binary-tree/avl-tree.ts +252 -0
  48. package/src/data-structures/binary-tree/binary-indexed-tree.ts +295 -1
  49. package/src/data-structures/binary-tree/binary-tree.ts +527 -2
  50. package/src/data-structures/binary-tree/bst.ts +505 -1
  51. package/src/data-structures/binary-tree/red-black-tree.ts +399 -0
  52. package/src/data-structures/binary-tree/segment-tree.ts +127 -2
  53. package/src/data-structures/binary-tree/tree-map.ts +2958 -459
  54. package/src/data-structures/binary-tree/tree-multi-map.ts +3069 -549
  55. package/src/data-structures/binary-tree/tree-multi-set.ts +2476 -460
  56. package/src/data-structures/binary-tree/tree-set.ts +2816 -422
  57. package/src/data-structures/graph/abstract-graph.ts +4 -4
  58. package/src/data-structures/graph/directed-graph.ts +210 -0
  59. package/src/data-structures/graph/undirected-graph.ts +189 -0
  60. package/src/data-structures/hash/hash-map.ts +246 -15
  61. package/src/data-structures/heap/heap.ts +294 -0
  62. package/src/data-structures/linked-list/doubly-linked-list.ts +360 -3
  63. package/src/data-structures/linked-list/singly-linked-list.ts +318 -3
  64. package/src/data-structures/linked-list/skip-linked-list.ts +380 -2
  65. package/src/data-structures/matrix/matrix.ts +169 -1
  66. package/src/data-structures/queue/deque.ts +320 -5
  67. package/src/data-structures/queue/queue.ts +252 -0
  68. package/src/data-structures/stack/stack.ts +210 -0
  69. package/src/data-structures/trie/trie.ts +257 -5
  70. package/src/interfaces/graph.ts +1 -1
  71. package/src/types/common.ts +2 -2
  72. package/src/types/data-structures/heap/heap.ts +1 -0
  73. package/src/types/data-structures/priority-queue/priority-queue.ts +1 -0
  74. package/src/types/utils/validate-type.ts +4 -4
@@ -350,6 +350,27 @@ var maxPriorityQueueTyped = (() => {
350
350
 
351
351
 
352
352
 
353
+
354
+
355
+
356
+
357
+
358
+
359
+
360
+
361
+
362
+
363
+
364
+
365
+
366
+
367
+
368
+
369
+
370
+
371
+
372
+
373
+
353
374
  * @example
354
375
  * // Track heap capacity
355
376
  * const heap = new Heap<number>();
@@ -413,6 +434,27 @@ var maxPriorityQueueTyped = (() => {
413
434
 
414
435
 
415
436
 
437
+
438
+
439
+
440
+
441
+
442
+
443
+
444
+
445
+
446
+
447
+
448
+
449
+
450
+
451
+
452
+
453
+
454
+
455
+
456
+
457
+
416
458
  * @example
417
459
  * // basic Heap creation and add operation
418
460
  * // Create a min heap (default)
@@ -446,6 +488,27 @@ var maxPriorityQueueTyped = (() => {
446
488
 
447
489
 
448
490
 
491
+
492
+
493
+
494
+
495
+
496
+
497
+
498
+
499
+
500
+
501
+
502
+
503
+
504
+
505
+
506
+
507
+
508
+
509
+
510
+
511
+
449
512
  * @example
450
513
  * // Add multiple elements
451
514
  * const heap = new Heap<number>([], { comparator: (a, b) => a - b });
@@ -481,6 +544,27 @@ var maxPriorityQueueTyped = (() => {
481
544
 
482
545
 
483
546
 
547
+
548
+
549
+
550
+
551
+
552
+
553
+
554
+
555
+
556
+
557
+
558
+
559
+
560
+
561
+
562
+
563
+
564
+
565
+
566
+
567
+
484
568
  * @example
485
569
  * // Heap with custom comparator (MaxHeap behavior)
486
570
  * interface Task {
@@ -532,6 +616,27 @@ var maxPriorityQueueTyped = (() => {
532
616
 
533
617
 
534
618
 
619
+
620
+
621
+
622
+
623
+
624
+
625
+
626
+
627
+
628
+
629
+
630
+
631
+
632
+
633
+
634
+
635
+
636
+
637
+
638
+
639
+
535
640
  * @example
536
641
  * // Heap for event processing with priority
537
642
  * interface Event {
@@ -608,6 +713,27 @@ var maxPriorityQueueTyped = (() => {
608
713
 
609
714
 
610
715
 
716
+
717
+
718
+
719
+
720
+
721
+
722
+
723
+
724
+
725
+
726
+
727
+
728
+
729
+
730
+
731
+
732
+
733
+
734
+
735
+
736
+
611
737
  * @example
612
738
  * // Check if heap is empty
613
739
  * const heap = new Heap<number>([], { comparator: (a, b) => a - b });
@@ -631,6 +757,27 @@ var maxPriorityQueueTyped = (() => {
631
757
 
632
758
 
633
759
 
760
+
761
+
762
+
763
+
764
+
765
+
766
+
767
+
768
+
769
+
770
+
771
+
772
+
773
+
774
+
775
+
776
+
777
+
778
+
779
+
780
+
634
781
  * @example
635
782
  * // Remove all elements
636
783
  * const heap = new Heap<number>([1, 2, 3], { comparator: (a, b) => a - b });
@@ -657,6 +804,27 @@ var maxPriorityQueueTyped = (() => {
657
804
  * @returns True if found.
658
805
 
659
806
 
807
+
808
+
809
+
810
+
811
+
812
+
813
+
814
+
815
+
816
+
817
+
818
+
819
+
820
+
821
+
822
+
823
+
824
+
825
+
826
+
827
+
660
828
  * @example
661
829
  * // Check element existence
662
830
  * const heap = new Heap<number>([3, 1, 2], { comparator: (a, b) => a - b });
@@ -680,6 +848,27 @@ var maxPriorityQueueTyped = (() => {
680
848
 
681
849
 
682
850
 
851
+
852
+
853
+
854
+
855
+
856
+
857
+
858
+
859
+
860
+
861
+
862
+
863
+
864
+
865
+
866
+
867
+
868
+
869
+
870
+
871
+
683
872
  * @example
684
873
  * // Remove specific element
685
874
  * const heap = new Heap<number>([3, 1, 4, 1, 5], { comparator: (a, b) => a - b });
@@ -749,6 +938,27 @@ var maxPriorityQueueTyped = (() => {
749
938
  * @returns Array of visited elements.
750
939
 
751
940
 
941
+
942
+
943
+
944
+
945
+
946
+
947
+
948
+
949
+
950
+
951
+
952
+
953
+
954
+
955
+
956
+
957
+
958
+
959
+
960
+
961
+
752
962
  * @example
753
963
  * // Depth-first traversal
754
964
  * const heap = new Heap<number>([3, 1, 2], { comparator: (a, b) => a - b });
@@ -805,6 +1015,27 @@ var maxPriorityQueueTyped = (() => {
805
1015
 
806
1016
 
807
1017
 
1018
+
1019
+
1020
+
1021
+
1022
+
1023
+
1024
+
1025
+
1026
+
1027
+
1028
+
1029
+
1030
+
1031
+
1032
+
1033
+
1034
+
1035
+
1036
+
1037
+
1038
+
808
1039
  * @example
809
1040
  * // Sort elements using heap
810
1041
  * const heap = new Heap<number>([5, 1, 3, 2, 4]);
@@ -834,6 +1065,27 @@ var maxPriorityQueueTyped = (() => {
834
1065
 
835
1066
 
836
1067
 
1068
+
1069
+
1070
+
1071
+
1072
+
1073
+
1074
+
1075
+
1076
+
1077
+
1078
+
1079
+
1080
+
1081
+
1082
+
1083
+
1084
+
1085
+
1086
+
1087
+
1088
+
837
1089
  * @example
838
1090
  * // Create independent copy
839
1091
  * const heap = new Heap<number>([3, 1, 4], { comparator: (a, b) => a - b });
@@ -862,6 +1114,27 @@ var maxPriorityQueueTyped = (() => {
862
1114
 
863
1115
 
864
1116
 
1117
+
1118
+
1119
+
1120
+
1121
+
1122
+
1123
+
1124
+
1125
+
1126
+
1127
+
1128
+
1129
+
1130
+
1131
+
1132
+
1133
+
1134
+
1135
+
1136
+
1137
+
865
1138
  * @example
866
1139
  * // Filter elements
867
1140
  * const heap = new Heap<number>([1, 2, 3, 4, 5], { comparator: (a, b) => a - b });
@@ -897,6 +1170,27 @@ var maxPriorityQueueTyped = (() => {
897
1170
 
898
1171
 
899
1172
 
1173
+
1174
+
1175
+
1176
+
1177
+
1178
+
1179
+
1180
+
1181
+
1182
+
1183
+
1184
+
1185
+
1186
+
1187
+
1188
+
1189
+
1190
+
1191
+
1192
+
1193
+
900
1194
  * @example
901
1195
  * // Transform elements
902
1196
  * const heap = new Heap<number>([1, 2, 3], { comparator: (a, b) => a - b });