data-structure-typed 1.46.7 → 1.46.8

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/CHANGELOG.md CHANGED
@@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file.
8
8
  - [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
9
9
  - [`auto-changelog`](https://github.com/CookPete/auto-changelog)
10
10
 
11
- ## [v1.46.7](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming)
11
+ ## [v1.46.8](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming)
12
12
 
13
13
  ### Changes
14
14
 
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
  Data Structures of Javascript & TypeScript.
13
13
 
14
- Do you envy C++ with [STL](), Python with [collections](), and Java with [java.util]() ? Well, no need to envy anymore! JavaScript and TypeScript now have [data-structure-typed]().
14
+ Do you envy C++ with [STL]() (std::), Python with [collections](), and Java with [java.util]() ? Well, no need to envy anymore! JavaScript and TypeScript now have [data-structure-typed]().
15
15
 
16
16
  Now you can use this library in Node.js and browser environments in CommonJS(require export.modules = ), ESModule(import export), Typescript(import export), UMD(var Queue = dataStructureTyped.Queue)
17
17
 
@@ -24,7 +24,6 @@ Now you can use this library in Node.js and browser environments in CommonJS(req
24
24
 
25
25
  [//]: # (![Lines](https://img.shields.io/badge/lines-68.6%25-red.svg?style=flat))
26
26
 
27
-
28
27
  ## Installation and Usage
29
28
 
30
29
  ### npm
@@ -117,8 +116,6 @@ const {
117
116
 
118
117
  ![](https://raw.githubusercontent.com/zrwusa/assets/master/images/data-structure-typed/examples/videos/webp_output/map-graph-test.webp)
119
118
 
120
-
121
-
122
119
  ## Code Snippets
123
120
 
124
121
  ### Binary Search Tree (BST) snippet
@@ -275,107 +272,6 @@ const dijkstraResult = graph.dijkstra('A');
275
272
  Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.key) // ['A', 'B', 'D']
276
273
  ```
277
274
 
278
- ## Built-in classic algorithms
279
-
280
- <table>
281
- <thead>
282
- <tr>
283
- <th>Algorithm</th>
284
- <th>Function Description</th>
285
- <th>Iteration Type</th>
286
- </tr>
287
- </thead>
288
- <tbody>
289
- <tr>
290
- <td>Binary Tree DFS</td>
291
- <td>Traverse a binary tree in a depth-first manner, starting from the root node, first visiting the left subtree,
292
- and then the right subtree, using recursion.
293
- </td>
294
- <td>Recursion + Iteration</td>
295
- </tr>
296
- <tr>
297
- <td>Binary Tree BFS</td>
298
- <td>Traverse a binary tree in a breadth-first manner, starting from the root node, visiting nodes level by level
299
- from left to right.
300
- </td>
301
- <td>Iteration</td>
302
- </tr>
303
- <tr>
304
- <td>Graph DFS</td>
305
- <td>Traverse a graph in a depth-first manner, starting from a given node, exploring along one path as deeply as
306
- possible, and backtracking to explore other paths. Used for finding connected components, paths, etc.
307
- </td>
308
- <td>Recursion + Iteration</td>
309
- </tr>
310
- <tr>
311
- <td>Binary Tree Morris</td>
312
- <td>Morris traversal is an in-order traversal algorithm for binary trees with O(1) space complexity. It allows tree
313
- traversal without additional stack or recursion.
314
- </td>
315
- <td>Iteration</td>
316
- </tr>
317
- <tr>
318
- <td>Graph BFS</td>
319
- <td>Traverse a graph in a breadth-first manner, starting from a given node, first visiting nodes directly connected
320
- to the starting node, and then expanding level by level. Used for finding shortest paths, etc.
321
- </td>
322
- <td>Recursion + Iteration</td>
323
- </tr>
324
- <tr>
325
- <td>Graph Tarjan's Algorithm</td>
326
- <td>Find strongly connected components in a graph, typically implemented using depth-first search.</td>
327
- <td>Recursion</td>
328
- </tr>
329
- <tr>
330
- <td>Graph Bellman-Ford Algorithm</td>
331
- <td>Finding the shortest paths from a single source, can handle negative weight edges</td>
332
- <td>Iteration</td>
333
- </tr>
334
- <tr>
335
- <td>Graph Dijkstra's Algorithm</td>
336
- <td>Finding the shortest paths from a single source, cannot handle negative weight edges</td>
337
- <td>Iteration</td>
338
- </tr>
339
- <tr>
340
- <td>Graph Floyd-Warshall Algorithm</td>
341
- <td>Finding the shortest paths between all pairs of nodes</td>
342
- <td>Iteration</td>
343
- </tr>
344
- <tr>
345
- <td>Graph getCycles</td>
346
- <td>Find all cycles in a graph or detect the presence of cycles.</td>
347
- <td>Recursion</td>
348
- </tr>
349
- <tr>
350
- <td>Graph getCutVertexes</td>
351
- <td>Find cut vertices in a graph, which are nodes that, when removed, increase the number of connected components in
352
- the graph.
353
- </td>
354
- <td>Recursion</td>
355
- </tr>
356
- <tr>
357
- <td>Graph getSCCs</td>
358
- <td>Find strongly connected components in a graph, which are subgraphs where any two nodes can reach each other.
359
- </td>
360
- <td>Recursion</td>
361
- </tr>
362
- <tr>
363
- <td>Graph getBridges</td>
364
- <td>Find bridges in a graph, which are edges that, when removed, increase the number of connected components in the
365
- graph.
366
- </td>
367
- <td>Recursion</td>
368
- </tr>
369
- <tr>
370
- <td>Graph topologicalSort</td>
371
- <td>Perform topological sorting on a directed acyclic graph (DAG) to find a linear order of nodes such that all
372
- directed edges go from earlier nodes to later nodes.
373
- </td>
374
- <td>Recursion</td>
375
- </tr>
376
- </tbody>
377
- </table>
378
-
379
275
  ## API docs & Examples
380
276
 
381
277
  [API Docs](https://data-structure-typed-docs.vercel.app)
@@ -568,11 +464,8 @@ Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.key) // ['A', 'B', '
568
464
  </tbody>
569
465
  </table>
570
466
 
571
-
572
-
573
467
  ## Standard library data structure comparison
574
468
 
575
-
576
469
  <table>
577
470
  <thead>
578
471
  <tr>
@@ -754,7 +647,6 @@ Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.key) // ['A', 'B', '
754
647
  </tbody>
755
648
  </table>
756
649
 
757
-
758
650
  ## Benchmark
759
651
 
760
652
  [//]: # (No deletion!!! Start of Replace Section)
@@ -810,6 +702,106 @@ Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.key) // ['A', 'B', '
810
702
 
811
703
  [//]: # (No deletion!!! End of Replace Section)
812
704
 
705
+ ## Built-in classic algorithms
706
+
707
+ <table>
708
+ <thead>
709
+ <tr>
710
+ <th>Algorithm</th>
711
+ <th>Function Description</th>
712
+ <th>Iteration Type</th>
713
+ </tr>
714
+ </thead>
715
+ <tbody>
716
+ <tr>
717
+ <td>Binary Tree DFS</td>
718
+ <td>Traverse a binary tree in a depth-first manner, starting from the root node, first visiting the left subtree,
719
+ and then the right subtree, using recursion.
720
+ </td>
721
+ <td>Recursion + Iteration</td>
722
+ </tr>
723
+ <tr>
724
+ <td>Binary Tree BFS</td>
725
+ <td>Traverse a binary tree in a breadth-first manner, starting from the root node, visiting nodes level by level
726
+ from left to right.
727
+ </td>
728
+ <td>Iteration</td>
729
+ </tr>
730
+ <tr>
731
+ <td>Graph DFS</td>
732
+ <td>Traverse a graph in a depth-first manner, starting from a given node, exploring along one path as deeply as
733
+ possible, and backtracking to explore other paths. Used for finding connected components, paths, etc.
734
+ </td>
735
+ <td>Recursion + Iteration</td>
736
+ </tr>
737
+ <tr>
738
+ <td>Binary Tree Morris</td>
739
+ <td>Morris traversal is an in-order traversal algorithm for binary trees with O(1) space complexity. It allows tree
740
+ traversal without additional stack or recursion.
741
+ </td>
742
+ <td>Iteration</td>
743
+ </tr>
744
+ <tr>
745
+ <td>Graph BFS</td>
746
+ <td>Traverse a graph in a breadth-first manner, starting from a given node, first visiting nodes directly connected
747
+ to the starting node, and then expanding level by level. Used for finding shortest paths, etc.
748
+ </td>
749
+ <td>Recursion + Iteration</td>
750
+ </tr>
751
+ <tr>
752
+ <td>Graph Tarjan's Algorithm</td>
753
+ <td>Find strongly connected components in a graph, typically implemented using depth-first search.</td>
754
+ <td>Recursion</td>
755
+ </tr>
756
+ <tr>
757
+ <td>Graph Bellman-Ford Algorithm</td>
758
+ <td>Finding the shortest paths from a single source, can handle negative weight edges</td>
759
+ <td>Iteration</td>
760
+ </tr>
761
+ <tr>
762
+ <td>Graph Dijkstra's Algorithm</td>
763
+ <td>Finding the shortest paths from a single source, cannot handle negative weight edges</td>
764
+ <td>Iteration</td>
765
+ </tr>
766
+ <tr>
767
+ <td>Graph Floyd-Warshall Algorithm</td>
768
+ <td>Finding the shortest paths between all pairs of nodes</td>
769
+ <td>Iteration</td>
770
+ </tr>
771
+ <tr>
772
+ <td>Graph getCycles</td>
773
+ <td>Find all cycles in a graph or detect the presence of cycles.</td>
774
+ <td>Recursion</td>
775
+ </tr>
776
+ <tr>
777
+ <td>Graph getCutVertexes</td>
778
+ <td>Find cut vertices in a graph, which are nodes that, when removed, increase the number of connected components in
779
+ the graph.
780
+ </td>
781
+ <td>Recursion</td>
782
+ </tr>
783
+ <tr>
784
+ <td>Graph getSCCs</td>
785
+ <td>Find strongly connected components in a graph, which are subgraphs where any two nodes can reach each other.
786
+ </td>
787
+ <td>Recursion</td>
788
+ </tr>
789
+ <tr>
790
+ <td>Graph getBridges</td>
791
+ <td>Find bridges in a graph, which are edges that, when removed, increase the number of connected components in the
792
+ graph.
793
+ </td>
794
+ <td>Recursion</td>
795
+ </tr>
796
+ <tr>
797
+ <td>Graph topologicalSort</td>
798
+ <td>Perform topological sorting on a directed acyclic graph (DAG) to find a linear order of nodes such that all
799
+ directed edges go from earlier nodes to later nodes.
800
+ </td>
801
+ <td>Recursion</td>
802
+ </tr>
803
+ </tbody>
804
+ </table>
813
805
 
814
806
  ## Software Engineering Design Standards
815
807
  <table>
@@ -858,3 +850,41 @@ Array.from(dijkstraResult?.seen ?? []).map(vertex => vertex.key) // ['A', 'B', '
858
850
  <td>Data structure software does not involve load issues.</td>
859
851
  </tr>
860
852
  </table>
853
+
854
+
855
+ <!-- START doctoc generated TOC please keep comment here to allow auto update -->
856
+ <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
857
+
858
+ - [Installation and Usage](#installation-and-usage)
859
+ - [npm](#npm)
860
+ - [yarn](#yarn)
861
+ - [CDN](#cdn)
862
+ - [development](#development)
863
+ - [production](#production)
864
+ - [Vivid Examples](#vivid-examples)
865
+ - [Binary Tree](#binary-tree)
866
+ - [Binary Tree DFS](#binary-tree-dfs)
867
+ - [AVL Tree](#avl-tree)
868
+ - [Tree Multi Map](#tree-multi-map)
869
+ - [Matrix](#matrix)
870
+ - [Directed Graph](#directed-graph)
871
+ - [Map Graph](#map-graph)
872
+ - [Code Snippets](#code-snippets)
873
+ - [Binary Search Tree (BST) snippet](#binary-search-tree-bst-snippet)
874
+ - [TS](#ts)
875
+ - [JS](#js)
876
+ - [AVLTree snippet](#avltree-snippet)
877
+ - [TS](#ts-1)
878
+ - [JS](#js-1)
879
+ - [Directed Graph simple snippet](#directed-graph-simple-snippet)
880
+ - [TS or JS](#ts-or-js)
881
+ - [Undirected Graph snippet](#undirected-graph-snippet)
882
+ - [TS or JS](#ts-or-js-1)
883
+ - [API docs & Examples](#api-docs--examples)
884
+ - [Data Structures](#data-structures)
885
+ - [Standard library data structure comparison](#standard-library-data-structure-comparison)
886
+ - [Benchmark](#benchmark)
887
+ - [Built-in classic algorithms](#built-in-classic-algorithms)
888
+ - [Software Engineering Design Standards](#software-engineering-design-standards)
889
+
890
+ <!-- END doctoc generated TOC please keep comment here to allow auto update -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "data-structure-typed",
3
- "version": "1.46.7",
3
+ "version": "1.46.8",
4
4
  "description": "Data Structures of Javascript & TypeScript. Heap, Binary Tree, RedBlack Tree, Linked List, Deque, Trie, HashMap, Directed Graph, Undirected Graph, Binary Search Tree(BST), AVL Tree, Priority Queue, Graph, Queue, Tree Multiset, Singly Linked List, Doubly Linked List, Max Heap, Max Priority Queue, Min Heap, Min Priority Queue, Stack.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/mjs/index.js",
@@ -38,6 +38,7 @@
38
38
  "install:all-subs": "npm i avl-tree-typed binary-tree-typed bst-typed deque-typed directed-graph-typed doubly-linked-list-typed graph-typed heap-typed linked-list-typed max-heap-typed max-priority-queue-typed min-heap-typed min-priority-queue-typed priority-queue-typed singly-linked-list-typed stack-typed tree-multimap-typed trie-typed undirected-graph-typed queue-typed --save-dev",
39
39
  "changelog": "auto-changelog",
40
40
  "coverage:badge": "istanbul-badges-readme",
41
+ "toc": "doctoc README.md",
41
42
  "copy:to-subs": "sh scripts/copy_to_all_subs.sh",
42
43
  "publish:subs": "npm run copy:to-subs && sh scripts/publish_all_subs.sh",
43
44
  "publish:docs": "sh scripts/publish_docs.sh",
@@ -61,7 +62,6 @@
61
62
  "@types/benchmark": "^2.1.3",
62
63
  "@types/jest": "^29.5.5",
63
64
  "@types/node": "^20.8.2",
64
- "@types/underscore": "^1.11.12",
65
65
  "@typescript-eslint/eslint-plugin": "^6.7.4",
66
66
  "@typescript-eslint/parser": "^6.7.4",
67
67
  "auto-changelog": "^2.4.0",
@@ -71,6 +71,7 @@
71
71
  "bst-typed": "^1.44.0",
72
72
  "data-structure-typed": "^1.44.0",
73
73
  "dependency-cruiser": "^14.1.0",
74
+ "doctoc": "^2.2.1",
74
75
  "eslint": "^8.50.0",
75
76
  "eslint-config-prettier": "^9.0.0",
76
77
  "eslint-import-resolver-alias": "^1.1.2",
@@ -15,7 +15,8 @@
15
15
  "skipLibCheck": true, // Skip type checking of type libraries.
16
16
  "strict": true, // Enable strict type checking, including enabling all strict options.
17
17
  "traceResolution": false, // Whether to trace the module resolution process.
18
- "types": ["node", "jest"] // Specifies the name of the type declaration file to include.
18
+ "types": ["node", "jest"], // Specifies the name of the type declaration file to include.
19
+ "typeRoots": ["node_modules/@types", "src/types", "test/types"]
19
20
  },
20
21
  "compileOnSave": false, // Whether to automatically compile when saving.
21
22
  "exclude": ["node_modules", "dist"], // Specify files or directories that should not be included in the compilation.