test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
10,000 add randomly | 30.52 | 32.76 | 3.28e-4 |
10,000 add & delete randomly | 66.96 | 14.94 | 0.00 |
10,000 addMany | 39.78 | 25.14 | 3.67e-4 |
10,000 get | 27.38 | 36.52 | 0.00 |
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f772f9..bcddaf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file. - [Semantic Versioning](https://semver.org/spec/v2.0.0.html) - [`auto-changelog`](https://github.com/CookPete/auto-changelog) -## [v1.42.5](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming) +## [v1.42.6](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...main) (upcoming) ### Changes diff --git a/README.md b/README.md index 71bc476..9813be8 100644 --- a/README.md +++ b/README.md @@ -25,108 +25,6 @@ Now you can use this library in Node.js and browser environments in CommonJS(req [//]: # (![Lines](https://img.shields.io/badge/lines-68.6%25-red.svg?style=flat)) -## Built-in classic algorithms - -
Algorithm | -Function Description | -Iteration Type | -
---|---|---|
Binary Tree DFS | -Traverse a binary tree in a depth-first manner, starting from the root node, first visiting the left subtree, - and then the right subtree, using recursion. - | -Recursion + Iteration | -
Binary Tree BFS | -Traverse a binary tree in a breadth-first manner, starting from the root node, visiting nodes level by level - from left to right. - | -Iteration | -
Graph DFS | -Traverse a graph in a depth-first manner, starting from a given node, exploring along one path as deeply as - possible, and backtracking to explore other paths. Used for finding connected components, paths, etc. - | -Recursion + Iteration | -
Binary Tree Morris | -Morris traversal is an in-order traversal algorithm for binary trees with O(1) space complexity. It allows tree - traversal without additional stack or recursion. - | -Iteration | -
Graph BFS | -Traverse a graph in a breadth-first manner, starting from a given node, first visiting nodes directly connected - to the starting node, and then expanding level by level. Used for finding shortest paths, etc. - | -Recursion + Iteration | -
Graph Tarjan's Algorithm | -Find strongly connected components in a graph, typically implemented using depth-first search. | -Recursion | -
Graph Bellman-Ford Algorithm | -Finding the shortest paths from a single source, can handle negative weight edges | -Iteration | -
Graph Dijkstra's Algorithm | -Finding the shortest paths from a single source, cannot handle negative weight edges | -Iteration | -
Graph Floyd-Warshall Algorithm | -Finding the shortest paths between all pairs of nodes | -Iteration | -
Graph getCycles | -Find all cycles in a graph or detect the presence of cycles. | -Recursion | -
Graph getCutVertexes | -Find cut vertices in a graph, which are nodes that, when removed, increase the number of connected components in - the graph. - | -Recursion | -
Graph getSCCs | -Find strongly connected components in a graph, which are subgraphs where any two nodes can reach each other. - | -Recursion | -
Graph getBridges | -Find bridges in a graph, which are edges that, when removed, increase the number of connected components in the - graph. - | -Recursion | -
Graph topologicalSort | -Perform topological sorting on a directed acyclic graph (DAG) to find a linear order of nodes such that all - directed edges go from earlier nodes to later nodes. - | -Recursion | -
Algorithm | +Function Description | +Iteration Type | +
---|---|---|
Binary Tree DFS | +Traverse a binary tree in a depth-first manner, starting from the root node, first visiting the left subtree, + and then the right subtree, using recursion. + | +Recursion + Iteration | +
Binary Tree BFS | +Traverse a binary tree in a breadth-first manner, starting from the root node, visiting nodes level by level + from left to right. + | +Iteration | +
Graph DFS | +Traverse a graph in a depth-first manner, starting from a given node, exploring along one path as deeply as + possible, and backtracking to explore other paths. Used for finding connected components, paths, etc. + | +Recursion + Iteration | +
Binary Tree Morris | +Morris traversal is an in-order traversal algorithm for binary trees with O(1) space complexity. It allows tree + traversal without additional stack or recursion. + | +Iteration | +
Graph BFS | +Traverse a graph in a breadth-first manner, starting from a given node, first visiting nodes directly connected + to the starting node, and then expanding level by level. Used for finding shortest paths, etc. + | +Recursion + Iteration | +
Graph Tarjan's Algorithm | +Find strongly connected components in a graph, typically implemented using depth-first search. | +Recursion | +
Graph Bellman-Ford Algorithm | +Finding the shortest paths from a single source, can handle negative weight edges | +Iteration | +
Graph Dijkstra's Algorithm | +Finding the shortest paths from a single source, cannot handle negative weight edges | +Iteration | +
Graph Floyd-Warshall Algorithm | +Finding the shortest paths between all pairs of nodes | +Iteration | +
Graph getCycles | +Find all cycles in a graph or detect the presence of cycles. | +Recursion | +
Graph getCutVertexes | +Find cut vertices in a graph, which are nodes that, when removed, increase the number of connected components in + the graph. + | +Recursion | +
Graph getSCCs | +Find strongly connected components in a graph, which are subgraphs where any two nodes can reach each other. + | +Recursion | +
Graph getBridges | +Find bridges in a graph, which are edges that, when removed, increase the number of connected components in the + graph. + | +Recursion | +
Graph topologicalSort | +Perform topological sorting on a directed acyclic graph (DAG) to find a linear order of nodes such that all + directed edges go from earlier nodes to later nodes. + | +Recursion | +
Red Black Tree | - | AVLTree | +RedBlackTree | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
10,000 add randomly | 30.52 | 32.76 | 3.28e-4 |
10,000 add & delete randomly | 66.96 | 14.94 | 0.00 |
10,000 addMany | 39.78 | 25.14 | 3.67e-4 |
10,000 get | 27.38 | 36.52 | 0.00 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
10,000 add randomly | 31.95 | 31.30 | 2.69e-4 |
10,000 add & delete randomly | 69.18 | 14.45 | 8.01e-4 |
10,000 addMany | 41.62 | 24.03 | 2.25e-4 |
10,000 get | 27.67 | 36.13 | 1.96e-4 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
1,000 add randomly | 10.50 | 95.20 | 2.30e-4 |
1,000 add & delete randomly | 16.18 | 61.81 | 2.48e-4 |
1,000 addMany | 10.80 | 92.62 | 1.83e-4 |
1,000 get | 18.03 | 55.45 | 1.41e-4 |
1,000 dfs | 157.86 | 6.33 | 0.00 |
1,000 bfs | 56.68 | 17.64 | 0.00 |
1,000 morris | 37.21 | 26.88 | 2.79e-4 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
1,000 add randomly | 12.29 | 81.38 | 9.60e-5 |
1,000 add & delete randomly | 15.60 | 64.11 | 1.04e-4 |
1,000 addMany | 10.30 | 97.04 | 9.16e-5 |
1,000 get | 18.02 | 55.50 | 2.21e-4 |
1,000 dfs | 175.42 | 5.70 | 0.00 |
1,000 bfs | 55.71 | 17.95 | 2.56e-4 |
1,000 morris | 38.29 | 26.11 | 2.10e-4 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
10,000 add randomly | 27.61 | 36.21 | 4.73e-4 |
10,000 add & delete randomly | 62.93 | 15.89 | 5.86e-4 |
10,000 addMany | 28.70 | 34.84 | 0.00 |
10,000 get | 27.67 | 36.14 | 2.92e-4 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
10,000 add randomly | 30.55 | 32.73 | 2.83e-4 |
10,000 add & delete randomly | 69.22 | 14.45 | 7.57e-4 |
10,000 addMany | 29.52 | 33.88 | 3.69e-4 |
10,000 get | 28.71 | 34.83 | 2.69e-4 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
100,000 add randomly | 87.51 | 11.43 | 0.01 |
100,000 add & delete randomly | 189.06 | 5.29 | 0.01 |
100,000 getNode | 35.33 | 28.31 | 8.93e-4 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
100,000 add randomly | 85.63 | 11.68 | 0.00 |
100,000 add & delete randomly | 181.31 | 5.52 | 0.01 |
100,000 getNode | 91.77 | 10.90 | 5.02e-4 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
1,000 addVertex | 0.10 | 9899.91 | 8.58e-7 |
1,000 addEdge | 6.06 | 165.02 | 1.68e-4 |
1,000 getVertex | 0.05 | 2.17e+4 | 4.22e-7 |
1,000 getEdge | 23.05 | 43.38 | 0.00 |
tarjan | 222.59 | 4.49 | 0.01 |
tarjan all | 226.89 | 4.41 | 0.01 |
topologicalSort | 187.34 | 5.34 | 0.01 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
1,000 addVertex | 0.10 | 9889.32 | 1.21e-6 |
1,000 addEdge | 5.97 | 167.63 | 1.09e-4 |
1,000 getVertex | 0.05 | 2.17e+4 | 4.36e-7 |
1,000 getEdge | 23.73 | 42.14 | 0.00 |
tarjan | 225.10 | 4.44 | 0.01 |
tarjan all | 233.47 | 4.28 | 0.02 |
topologicalSort | 183.96 | 5.44 | 0.00 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
10,000 add & pop | 4.66 | 214.54 | 9.38e-5 |
10,000 fib add & pop | 364.30 | 2.74 | 0.01 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
10,000 add & pop | 4.61 | 216.99 | 4.19e-5 |
10,000 fib add & pop | 354.79 | 2.82 | 0.00 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
1,000,000 unshift | 243.61 | 4.10 | 0.07 |
1,000,000 unshift & shift | 173.32 | 5.77 | 0.03 |
1,000,000 insertBefore | 315.86 | 3.17 | 0.04 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
1,000,000 unshift | 210.07 | 4.76 | 0.03 |
1,000,000 unshift & shift | 174.44 | 5.73 | 0.04 |
1,000,000 insertBefore | 355.36 | 2.81 | 0.10 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
10,000 push & pop | 228.06 | 4.38 | 0.03 |
10,000 insertBefore | 252.07 | 3.97 | 0.01 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
10,000 push & pop | 220.47 | 4.54 | 0.01 |
10,000 insertBefore | 252.59 | 3.96 | 0.00 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
10,000 refill & poll | 11.53 | 86.71 | 2.27e-4 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
10,000 refill & poll | 11.72 | 85.32 | 2.97e-4 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
1,000,000 push | 227.24 | 4.40 | 0.07 |
1,000,000 shift | 25.60 | 39.07 | 0.00 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
1,000,000 push | 233.90 | 4.28 | 0.07 |
1,000,000 shift | 25.40 | 39.37 | 0.00 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
1,000,000 push | 45.98 | 21.75 | 0.01 |
1,000,000 push & shift | 81.12 | 12.33 | 0.00 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
1,000,000 push | 43.54 | 22.97 | 0.00 |
1,000,000 push & shift | 83.99 | 11.91 | 0.00 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
100,000 push | 59.40 | 16.83 | 0.01 |
100,000 getWords | 90.07 | 11.10 | 0.00 |
test name | time taken (ms) | executions per sec | sample deviation |
---|---|---|---|
100,000 push | 49.17 | 20.34 | 0.01 |
100,000 getWords | 88.84 | 11.26 | 0.01 |