From c92e1974fec4f8af0569b0c26c899e86a85a6416 Mon Sep 17 00:00:00 2001 From: Revone Date: Thu, 7 Dec 2023 10:47:50 +0800 Subject: [PATCH] docs: Reorganize the correspondence of data structures in different languages once again. --- README.md | 90 +++++++++++++++++++--------------------------------- package.json | 2 +- 2 files changed, 34 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index 9ecfd30..6cc8cea 100644 --- a/README.md +++ b/README.md @@ -496,24 +496,12 @@ avl2.print(); View -Tree Multiset +Tree Multimap View -Segment Tree - - -View - - -Binary Indexed Tree - - -View - - Heap @@ -603,6 +591,18 @@ avl2.print(); View + +Segment Tree + + +View + + +Binary Indexed Tree + + +View + @@ -685,7 +685,7 @@ avl2.print(); - - - + TreeMultimap<E> multiset<T> - - @@ -727,28 +727,10 @@ avl2.print(); - - Set<E> - - - HashSet<E> - set - - - HashMap<K, V> - - - HashMap<K, V> - dict - - - - + HashMap<E> unordered_set<T> HashSet<E> - - - - - Map<K, V> - - - - - OrderedDict + set - @@ -756,17 +738,11 @@ avl2.print(); - Counter - - - - - - LinkedHashSet<E> - - - LinkedHashMap<K, V> - LinkedHashMap<K, V> - - + OrderedDict - @@ -788,52 +764,52 @@ avl2.print(); [//]: # (No deletion!!! Start of Replace Section)
avl-tree
-
test nametime taken (ms)executions per secsample deviation
10,000 add randomly28.0135.703.60e-4
10,000 add & delete randomly68.1914.660.00
10,000 addMany34.3729.103.01e-4
10,000 get28.6134.962.81e-4
+
test nametime taken (ms)executions per secsample deviation
10,000 add randomly72.4813.800.03
10,000 add & delete randomly144.146.940.03
10,000 addMany69.7114.350.02
10,000 get54.2118.450.01
binary-tree
-
test nametime taken (ms)executions per secsample deviation
1,000 add randomly13.7872.579.19e-5
1,000 add & delete randomly21.5046.521.81e-4
1,000 addMany15.9162.851.16e-4
1,000 get18.1655.081.86e-4
1,000 has18.1655.061.82e-4
1,000 dfs161.466.195.35e-4
1,000 bfs56.3217.764.17e-4
1,000 morris257.593.886.92e-4
+
test nametime taken (ms)executions per secsample deviation
1,000 add randomly15.8463.140.00
1,000 add & delete randomly24.6240.620.00
1,000 addMany17.8556.010.00
1,000 get20.8348.000.00
1,000 has20.7848.130.00
1,000 dfs186.065.370.02
1,000 bfs66.5815.020.02
1,000 morris298.233.350.02
bst
-
test nametime taken (ms)executions per secsample deviation
10,000 add randomly26.9437.122.41e-4
10,000 add & delete randomly69.3314.425.46e-4
10,000 addMany28.1735.503.03e-4
10,000 get31.4031.852.49e-4
+
test nametime taken (ms)executions per secsample deviation
10,000 add randomly55.0418.170.01
10,000 add & delete randomly129.857.700.01
10,000 addMany50.4019.840.01
10,000 get63.3915.780.01
rb-tree
-
test nametime taken (ms)executions per secsample deviation
100,000 add84.9511.770.00
100,000 add & delete randomly214.084.670.00
100,000 getNode43.2123.143.41e-4
100,000 add & iterator115.988.620.00
+
test nametime taken (ms)executions per secsample deviation
100,000 add113.258.830.02
100,000 add & delete randomly305.283.280.03
100,000 getNode73.2013.660.03
100,000 add & iterator159.806.260.06
comparison
-
test nametime taken (ms)executions per secsample deviation
SRC PQ 10,000 add0.146958.081.96e-6
CJS PQ 10,000 add0.146945.481.85e-6
MJS PQ 10,000 add0.571758.676.72e-6
SRC PQ 10,000 add & pop3.41293.063.56e-5
CJS PQ 10,000 add & pop3.40293.883.65e-5
MJS PQ 10,000 add & pop3.30302.863.70e-5
+
test nametime taken (ms)executions per secsample deviation
SRC PQ 10,000 add0.175872.024.08e-5
CJS PQ 10,000 add0.204961.221.14e-4
MJS PQ 10,000 add0.741351.472.98e-4
SRC PQ 10,000 add & pop4.62216.490.00
CJS PQ 10,000 add & pop4.36229.400.00
MJS PQ 10,000 add & pop3.92255.230.00
directed-graph
-
test nametime taken (ms)executions per secsample deviation
1,000 addVertex0.109990.481.15e-6
1,000 addEdge6.30158.817.72e-4
1,000 getVertex0.052.15e+43.77e-7
1,000 getEdge22.5644.330.00
tarjan213.114.690.01
tarjan all212.234.719.29e-4
topologicalSort170.965.850.00
+
test nametime taken (ms)executions per secsample deviation
1,000 addVertex0.128557.702.46e-5
1,000 addEdge7.37135.700.00
1,000 getVertex0.051.91e+41.12e-5
1,000 getEdge22.7543.960.00
tarjan196.985.080.01
tarjan all217.254.600.03
topologicalSort177.305.640.02
hash-map
-
test nametime taken (ms)executions per secsample deviation
1,000,000 set120.978.270.05
1,000,000 Map set217.884.590.03
1,000,000 Set add171.455.830.02
1,000,000 set & get116.498.580.02
1,000,000 Map set & get271.493.680.02
1,000,000 Set add & has173.055.780.02
1,000,000 ObjKey set & get314.333.180.04
1,000,000 Map ObjKey set & get275.933.620.06
1,000,000 Set ObjKey add & has277.403.600.08
+
test nametime taken (ms)executions per secsample deviation
1,000,000 set153.746.500.07
1,000,000 Map set330.023.030.16
1,000,000 Set add258.643.870.06
1,000,000 set & get138.807.200.06
1,000,000 Map set & get352.632.840.05
1,000,000 Set add & has217.974.590.02
1,000,000 ObjKey set & get414.872.410.06
1,000,000 Map ObjKey set & get389.172.570.07
1,000,000 Set ObjKey add & has352.672.840.03
heap
-
test nametime taken (ms)executions per secsample deviation
100,000 add & pop80.1812.470.00
100,000 add & dfs35.4028.250.00
10,000 fib add & pop360.712.770.00
+
test nametime taken (ms)executions per secsample deviation
100,000 add & pop90.6711.030.02
100,000 add & dfs40.3024.810.01
10,000 fib add & pop414.942.410.02
doubly-linked-list
-
test nametime taken (ms)executions per secsample deviation
1,000,000 push242.044.130.04
1,000,000 unshift204.374.890.03
1,000,000 unshift & shift178.895.590.03
1,000,000 insertBefore325.643.070.07
+
test nametime taken (ms)executions per secsample deviation
1,000,000 push290.623.440.10
1,000,000 unshift253.883.940.10
1,000,000 unshift & shift259.653.850.14
1,000,000 insertBefore463.162.160.10
singly-linked-list
-
test nametime taken (ms)executions per secsample deviation
10,000 push & pop216.934.610.02
10,000 insertBefore247.434.040.00
+
test nametime taken (ms)executions per secsample deviation
1,000,000 push & shift250.274.000.08
10,000 push & pop261.133.830.03
10,000 insertBefore282.463.540.02
max-priority-queue
-
test nametime taken (ms)executions per secsample deviation
10,000 refill & poll8.92112.151.68e-4
+
test nametime taken (ms)executions per secsample deviation
10,000 refill & poll10.4995.290.00
priority-queue
-
test nametime taken (ms)executions per secsample deviation
100,000 add & pop101.579.850.00
+
test nametime taken (ms)executions per secsample deviation
100,000 add & pop110.639.040.01
deque
-
test nametime taken (ms)executions per secsample deviation
1,000,000 push13.8372.301.57e-4
1,000,000 push & pop22.7843.904.69e-4
1,000,000 push & shift23.8042.021.75e-4
1,000,000 unshift & shift22.0445.372.74e-4
+
test nametime taken (ms)executions per secsample deviation
1,000,000 push15.8962.920.00
1,000,000 push & pop26.4537.810.01
1,000,000 push & shift27.5236.340.00
1,000,000 unshift & shift28.8234.700.01
queue
-
test nametime taken (ms)executions per secsample deviation
1,000,000 push39.1725.530.00
1,000,000 push & shift82.1212.180.00
+
test nametime taken (ms)executions per secsample deviation
1,000,000 push51.2119.530.02
1,000,000 push & shift105.569.470.05
stack
-
test nametime taken (ms)executions per secsample deviation
1,000,000 push40.2024.880.01
1,000,000 push & pop49.2720.300.01
+
test nametime taken (ms)executions per secsample deviation
1,000,000 push43.5722.950.01
1,000,000 push & pop55.1818.120.01
trie
-
test nametime taken (ms)executions per secsample deviation
100,000 push45.2922.086.76e-4
100,000 getWords86.6811.540.00
+
test nametime taken (ms)executions per secsample deviation
100,000 push54.0818.490.01
100,000 getWords77.7712.860.02
[//]: # (No deletion!!! End of Replace Section) diff --git a/package.json b/package.json index 39d62bd..d604014 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "data-structure-typed", - "version": "1.48.5", + "version": "1.48.6", "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.", "main": "dist/cjs/index.js", "module": "dist/mjs/index.js",