data-structure-typed 2.6.0 → 2.6.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 (80) hide show
  1. package/.github/workflows/ci.yml +7 -2
  2. package/.github/workflows/release-package.yml +9 -2
  3. package/docs-site-docusaurus/docs/api/classes/AVLTree.md +108 -108
  4. package/docs-site-docusaurus/docs/api/classes/BST.md +101 -101
  5. package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +13 -13
  6. package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +66 -66
  7. package/docs-site-docusaurus/docs/api/classes/Deque.md +235 -51
  8. package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +21 -21
  9. package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +231 -67
  10. package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +9 -9
  11. package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +1 -1
  12. package/docs-site-docusaurus/docs/api/classes/HashMap.md +14 -14
  13. package/docs-site-docusaurus/docs/api/classes/Heap.md +117 -34
  14. package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +83 -13
  15. package/docs-site-docusaurus/docs/api/classes/LinearBase.md +124 -20
  16. package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +140 -32
  17. package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +23 -23
  18. package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +159 -51
  19. package/docs-site-docusaurus/docs/api/classes/MapGraph.md +20 -20
  20. package/docs-site-docusaurus/docs/api/classes/Matrix.md +23 -23
  21. package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +117 -34
  22. package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +117 -34
  23. package/docs-site-docusaurus/docs/api/classes/MinHeap.md +117 -34
  24. package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +117 -34
  25. package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +117 -34
  26. package/docs-site-docusaurus/docs/api/classes/Queue.md +142 -34
  27. package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +117 -117
  28. package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +8 -8
  29. package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +158 -50
  30. package/docs-site-docusaurus/docs/api/classes/SkipList.md +21 -21
  31. package/docs-site-docusaurus/docs/api/classes/Stack.md +108 -26
  32. package/docs-site-docusaurus/docs/api/classes/TreeMap.md +33 -33
  33. package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +75 -39
  34. package/docs-site-docusaurus/docs/api/classes/TreeSet.md +301 -39
  35. package/docs-site-docusaurus/docs/api/classes/Trie.md +110 -28
  36. package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +20 -20
  37. package/package.json +45 -46
  38. package/src/common/error.ts +15 -32
  39. package/src/common/index.ts +0 -3
  40. package/src/data-structures/base/iterable-element-base.ts +0 -3
  41. package/src/data-structures/base/linear-base.ts +2 -36
  42. package/src/data-structures/binary-tree/avl-tree.ts +31 -529
  43. package/src/data-structures/binary-tree/binary-indexed-tree.ts +47 -572
  44. package/src/data-structures/binary-tree/binary-tree.ts +326 -1311
  45. package/src/data-structures/binary-tree/bst.ts +158 -1082
  46. package/src/data-structures/binary-tree/red-black-tree.ts +451 -1290
  47. package/src/data-structures/binary-tree/segment-tree.ts +73 -351
  48. package/src/data-structures/binary-tree/tree-map.ts +462 -5124
  49. package/src/data-structures/binary-tree/tree-multi-map.ts +302 -4914
  50. package/src/data-structures/binary-tree/tree-multi-set.ts +284 -3972
  51. package/src/data-structures/binary-tree/tree-set.ts +338 -4836
  52. package/src/data-structures/graph/abstract-graph.ts +98 -167
  53. package/src/data-structures/graph/directed-graph.ts +137 -562
  54. package/src/data-structures/graph/map-graph.ts +0 -3
  55. package/src/data-structures/graph/undirected-graph.ts +132 -511
  56. package/src/data-structures/hash/hash-map.ts +154 -582
  57. package/src/data-structures/heap/heap.ts +200 -795
  58. package/src/data-structures/linked-list/doubly-linked-list.ts +121 -865
  59. package/src/data-structures/linked-list/singly-linked-list.ts +122 -794
  60. package/src/data-structures/linked-list/skip-linked-list.ts +211 -918
  61. package/src/data-structures/matrix/matrix.ts +179 -518
  62. package/src/data-structures/matrix/navigator.ts +0 -1
  63. package/src/data-structures/priority-queue/max-priority-queue.ts +1 -6
  64. package/src/data-structures/priority-queue/min-priority-queue.ts +6 -11
  65. package/src/data-structures/priority-queue/priority-queue.ts +1 -2
  66. package/src/data-structures/queue/deque.ts +214 -882
  67. package/src/data-structures/queue/queue.ts +102 -625
  68. package/src/data-structures/stack/stack.ts +76 -505
  69. package/src/data-structures/trie/trie.ts +98 -628
  70. package/src/types/common.ts +0 -10
  71. package/src/types/data-structures/binary-tree/bst.ts +0 -7
  72. package/src/types/data-structures/binary-tree/red-black-tree.ts +0 -1
  73. package/src/types/data-structures/graph/abstract-graph.ts +0 -2
  74. package/src/types/data-structures/hash/hash-map.ts +0 -3
  75. package/src/types/data-structures/hash/index.ts +0 -1
  76. package/src/types/data-structures/matrix/navigator.ts +0 -2
  77. package/src/types/utils/utils.ts +0 -7
  78. package/src/types/utils/validate-type.ts +0 -7
  79. package/src/utils/number.ts +0 -2
  80. package/src/utils/utils.ts +0 -5
@@ -495,7 +495,7 @@ Time O(V * E), Space O(V + E)
495
495
  clear(): void;
496
496
  ```
497
497
 
498
- Defined in: [data-structures/graph/directed-graph.ts:944](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L944)
498
+ Defined in: [data-structures/graph/directed-graph.ts:968](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L968)
499
499
 
500
500
  Remove all vertices and edges.
501
501
 
@@ -525,7 +525,7 @@ IGraph.clear
525
525
  clone(): this;
526
526
  ```
527
527
 
528
- Defined in: [data-structures/graph/directed-graph.ts:955](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L955)
528
+ Defined in: [data-structures/graph/directed-graph.ts:979](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L979)
529
529
 
530
530
  Deep clone as the same concrete class.
531
531
 
@@ -665,7 +665,7 @@ IGraph.createVertex
665
665
  degreeOf(vertexOrKey): number;
666
666
  ```
667
667
 
668
- Defined in: [data-structures/graph/directed-graph.ts:626](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L626)
668
+ Defined in: [data-structures/graph/directed-graph.ts:641](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L641)
669
669
 
670
670
  Degree (in + out) of a vertex.
671
671
 
@@ -705,7 +705,7 @@ IGraph.degreeOf
705
705
  deleteEdge(edgeOrSrcVertexKey, destVertexKey?): EO | undefined;
706
706
  ```
707
707
 
708
- Defined in: [data-structures/graph/directed-graph.ts:381](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L381)
708
+ Defined in: [data-structures/graph/directed-graph.ts:387](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L387)
709
709
 
710
710
  Delete an edge by instance or by `(srcKey, destKey)`.
711
711
 
@@ -782,7 +782,7 @@ IGraph.deleteEdge
782
782
  deleteEdgeSrcToDest(srcOrKey, destOrKey): EO | undefined;
783
783
  ```
784
784
 
785
- Defined in: [data-structures/graph/directed-graph.ts:290](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L290)
785
+ Defined in: [data-structures/graph/directed-graph.ts:293](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L293)
786
786
 
787
787
  Delete edge `src -> dest` if present.
788
788
 
@@ -818,7 +818,7 @@ Time O(1) avg, Space O(1)
818
818
  deleteVertex(vertexOrKey): boolean;
819
819
  ```
820
820
 
821
- Defined in: [data-structures/graph/directed-graph.ts:459](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L459)
821
+ Defined in: [data-structures/graph/directed-graph.ts:468](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L468)
822
822
 
823
823
  Remove a vertex
824
824
 
@@ -921,7 +921,7 @@ Time O(V^2 + E), Space O(V + E)
921
921
  edgeSet(): EO[];
922
922
  ```
923
923
 
924
- Defined in: [data-structures/graph/directed-graph.ts:839](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L839)
924
+ Defined in: [data-structures/graph/directed-graph.ts:860](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L860)
925
925
 
926
926
  Get all edges
927
927
 
@@ -960,7 +960,7 @@ IGraph.edgeSet
960
960
  edgesOf(vertexOrKey): EO[];
961
961
  ```
962
962
 
963
- Defined in: [data-structures/graph/directed-graph.ts:656](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L656)
963
+ Defined in: [data-structures/graph/directed-graph.ts:671](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L671)
964
964
 
965
965
  All incident edges of a vertex.
966
966
 
@@ -1380,7 +1380,7 @@ Time exponential in worst-case, Space O(V + E)
1380
1380
  getDestinations(vertex): VO[];
1381
1381
  ```
1382
1382
 
1383
- Defined in: [data-structures/graph/directed-graph.ts:674](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L674)
1383
+ Defined in: [data-structures/graph/directed-graph.ts:689](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L689)
1384
1384
 
1385
1385
  Direct children reachable by one outgoing edge.
1386
1386
 
@@ -1410,7 +1410,7 @@ Time O(deg_out), Space O(deg_out)
1410
1410
  getDFNMap(): Map<VO, number>;
1411
1411
  ```
1412
1412
 
1413
- Defined in: [data-structures/graph/directed-graph.ts:1069](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1069)
1413
+ Defined in: [data-structures/graph/directed-graph.ts:1096](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1096)
1414
1414
 
1415
1415
  DFN index map computed by `tarjan()`.
1416
1416
 
@@ -1432,7 +1432,7 @@ Time O(V), Space O(V)
1432
1432
  getEdge(srcOrKey, destOrKey): EO | undefined;
1433
1433
  ```
1434
1434
 
1435
- Defined in: [data-structures/graph/directed-graph.ts:265](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L265)
1435
+ Defined in: [data-structures/graph/directed-graph.ts:268](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L268)
1436
1436
 
1437
1437
  Get the unique edge from `src` to `dest`, if present.
1438
1438
 
@@ -1492,7 +1492,7 @@ IGraph.getEdge
1492
1492
  getEndsOfEdge(edge): [VO, VO] | undefined;
1493
1493
  ```
1494
1494
 
1495
- Defined in: [data-structures/graph/directed-graph.ts:919](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L919)
1495
+ Defined in: [data-structures/graph/directed-graph.ts:943](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L943)
1496
1496
 
1497
1497
  Resolve an edge's `[src, dest]` endpoints to vertex instances.
1498
1498
 
@@ -1532,7 +1532,7 @@ IGraph.getEndsOfEdge
1532
1532
  getLowMap(): Map<VO, number>;
1533
1533
  ```
1534
1534
 
1535
- Defined in: [data-structures/graph/directed-graph.ts:1078](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1078)
1535
+ Defined in: [data-structures/graph/directed-graph.ts:1105](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1105)
1536
1536
 
1537
1537
  LOW link map computed by `tarjan()`.
1538
1538
 
@@ -1659,7 +1659,7 @@ Time O((V + E) log V) weighted / O(V + E) unweighted, Space O(V + E)
1659
1659
  getNeighbors(vertexOrKey): VO[];
1660
1660
  ```
1661
1661
 
1662
- Defined in: [data-structures/graph/directed-graph.ts:897](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L897)
1662
+ Defined in: [data-structures/graph/directed-graph.ts:921](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L921)
1663
1663
 
1664
1664
  Get outgoing neighbors
1665
1665
 
@@ -1741,7 +1741,7 @@ Time O(L), Space O(1) where L is path length
1741
1741
  getSCCs(): Map<number, VO[]>;
1742
1742
  ```
1743
1743
 
1744
- Defined in: [data-structures/graph/directed-graph.ts:1134](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1134)
1744
+ Defined in: [data-structures/graph/directed-graph.ts:1164](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1164)
1745
1745
 
1746
1746
  Strongly connected components computed by `tarjan()`.
1747
1747
 
@@ -1968,7 +1968,7 @@ IGraph.hasVertex
1968
1968
  incomingEdgesOf(vertexOrKey): EO[];
1969
1969
  ```
1970
1970
 
1971
- Defined in: [data-structures/graph/directed-graph.ts:553](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L553)
1971
+ Defined in: [data-structures/graph/directed-graph.ts:565](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L565)
1972
1972
 
1973
1973
  Incoming edges of a vertex.
1974
1974
 
@@ -2013,7 +2013,7 @@ Time O(deg_in), Space O(deg_in)
2013
2013
  isEmpty(): boolean;
2014
2014
  ```
2015
2015
 
2016
- Defined in: [data-structures/graph/directed-graph.ts:936](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L936)
2016
+ Defined in: [data-structures/graph/directed-graph.ts:960](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L960)
2017
2017
 
2018
2018
  Whether the graph has no vertices and no edges.
2019
2019
 
@@ -2143,7 +2143,7 @@ Time O(n), Space O(n)
2143
2143
  outgoingEdgesOf(vertexOrKey): EO[];
2144
2144
  ```
2145
2145
 
2146
- Defined in: [data-structures/graph/directed-graph.ts:612](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L612)
2146
+ Defined in: [data-structures/graph/directed-graph.ts:627](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L627)
2147
2147
 
2148
2148
  Outgoing edges of a vertex.
2149
2149
 
@@ -2387,7 +2387,7 @@ Time O(n), Space O(1)
2387
2387
  tarjan(): object;
2388
2388
  ```
2389
2389
 
2390
- Defined in: [data-structures/graph/directed-graph.ts:1013](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1013)
2390
+ Defined in: [data-structures/graph/directed-graph.ts:1040](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1040)
2391
2391
 
2392
2392
  Tarjan's algorithm for strongly connected components.
2393
2393
 
@@ -2512,7 +2512,7 @@ DOT format string.
2512
2512
  topologicalSort(propertyName?): (VertexKey | VO)[] | undefined;
2513
2513
  ```
2514
2514
 
2515
- Defined in: [data-structures/graph/directed-graph.ts:756](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L756)
2515
+ Defined in: [data-structures/graph/directed-graph.ts:774](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L774)
2516
2516
 
2517
2517
  Topological sort if DAG; returns `undefined` if a cycle exists.
2518
2518
 
@@ -2742,7 +2742,7 @@ Override in subclasses (e.g., '--' for undirected, '->' for directed).
2742
2742
  protected _addEdge(edge): boolean;
2743
2743
  ```
2744
2744
 
2745
- Defined in: [data-structures/graph/directed-graph.ts:1144](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1144)
2745
+ Defined in: [data-structures/graph/directed-graph.ts:1174](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/graph/directed-graph.ts#L1174)
2746
2746
 
2747
2747
  Internal hook to attach a directed edge into adjacency maps.
2748
2748