Skip to content

Commit

Permalink
docs: Almost all methods of data structures have added comments on ti…
Browse files Browse the repository at this point in the history
…me and space complexity.
  • Loading branch information
zrwusa committed Nov 10, 2023
1 parent d3a56a5 commit fd416c5
Show file tree
Hide file tree
Showing 13 changed files with 1,439 additions and 40 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -728,40 +728,40 @@ optimal approach to data structure design.
[//]: # (No deletion!!! Start of Replace Section)
<div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>avl-tree</span></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add randomly</td><td>45.48</td><td>21.99</td><td>0.04</td></tr><tr><td>10,000 add & delete randomly</td><td>132.35</td><td>7.56</td><td>0.10</td></tr><tr><td>10,000 addMany</td><td>79.22</td><td>12.62</td><td>0.07</td></tr><tr><td>10,000 get</td><td>93.13</td><td>10.74</td><td>0.06</td></tr></table></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add randomly</td><td>32.91</td><td>30.38</td><td>6.85e-4</td></tr><tr><td>10,000 add & delete randomly</td><td>73.84</td><td>13.54</td><td>0.00</td></tr><tr><td>10,000 addMany</td><td>43.79</td><td>22.84</td><td>0.00</td></tr><tr><td>10,000 get</td><td>29.07</td><td>34.40</td><td>7.13e-4</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>binary-tree</span></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000 add randomly</td><td>23.89</td><td>41.85</td><td>0.01</td></tr><tr><td>1,000 add & delete randomly</td><td>22.84</td><td>43.78</td><td>0.01</td></tr><tr><td>1,000 addMany</td><td>10.61</td><td>94.22</td><td>4.91e-4</td></tr><tr><td>1,000 get</td><td>18.56</td><td>53.87</td><td>8.86e-4</td></tr><tr><td>1,000 dfs</td><td>158.90</td><td>6.29</td><td>0.00</td></tr><tr><td>1,000 bfs</td><td>58.59</td><td>17.07</td><td>0.00</td></tr><tr><td>1,000 morris</td><td>269.91</td><td>3.70</td><td>0.01</td></tr></table></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000 add randomly</td><td>12.65</td><td>79.06</td><td>2.71e-4</td></tr><tr><td>1,000 add & delete randomly</td><td>16.43</td><td>60.86</td><td>0.00</td></tr><tr><td>1,000 addMany</td><td>10.25</td><td>97.59</td><td>1.46e-4</td></tr><tr><td>1,000 get</td><td>18.02</td><td>55.48</td><td>1.61e-4</td></tr><tr><td>1,000 dfs</td><td>156.29</td><td>6.40</td><td>0.00</td></tr><tr><td>1,000 bfs</td><td>56.06</td><td>17.84</td><td>5.29e-4</td></tr><tr><td>1,000 morris</td><td>260.47</td><td>3.84</td><td>0.00</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>bst</span></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add randomly</td><td>31.66</td><td>31.59</td><td>8.90e-4</td></tr><tr><td>10,000 add & delete randomly</td><td>73.97</td><td>13.52</td><td>0.00</td></tr><tr><td>10,000 addMany</td><td>31.66</td><td>31.58</td><td>0.00</td></tr><tr><td>10,000 get</td><td>29.75</td><td>33.61</td><td>5.49e-4</td></tr></table></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add randomly</td><td>31.67</td><td>31.58</td><td>9.08e-4</td></tr><tr><td>10,000 add & delete randomly</td><td>73.30</td><td>13.64</td><td>0.01</td></tr><tr><td>10,000 addMany</td><td>30.35</td><td>32.95</td><td>0.00</td></tr><tr><td>10,000 get</td><td>29.49</td><td>33.91</td><td>7.80e-4</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>rb-tree</span></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>100,000 add randomly</td><td>87.24</td><td>11.46</td><td>0.00</td></tr><tr><td>100,000 add & delete randomly</td><td>218.78</td><td>4.57</td><td>0.01</td></tr><tr><td>100,000 getNode</td><td>91.39</td><td>10.94</td><td>0.00</td></tr></table></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>100,000 add randomly</td><td>90.85</td><td>11.01</td><td>0.01</td></tr><tr><td>100,000 add & delete randomly</td><td>238.18</td><td>4.20</td><td>0.07</td></tr><tr><td>100,000 getNode</td><td>111.04</td><td>9.01</td><td>0.03</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>directed-graph</span></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000 addVertex</td><td>0.10</td><td>9631.84</td><td>5.21e-6</td></tr><tr><td>1,000 addEdge</td><td>6.25</td><td>160.06</td><td>3.97e-4</td></tr><tr><td>1,000 getVertex</td><td>0.05</td><td>2.13e+4</td><td>1.05e-6</td></tr><tr><td>1,000 getEdge</td><td>23.83</td><td>41.97</td><td>0.00</td></tr><tr><td>tarjan</td><td>217.69</td><td>4.59</td><td>0.01</td></tr><tr><td>tarjan all</td><td>226.43</td><td>4.42</td><td>0.01</td></tr><tr><td>topologicalSort</td><td>180.71</td><td>5.53</td><td>0.01</td></tr></table></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000 addVertex</td><td>0.10</td><td>9609.82</td><td>5.99e-6</td></tr><tr><td>1,000 addEdge</td><td>6.43</td><td>155.61</td><td>4.69e-4</td></tr><tr><td>1,000 getVertex</td><td>0.05</td><td>2.10e+4</td><td>2.90e-6</td></tr><tr><td>1,000 getEdge</td><td>23.98</td><td>41.70</td><td>0.01</td></tr><tr><td>tarjan</td><td>225.87</td><td>4.43</td><td>0.02</td></tr><tr><td>tarjan all</td><td>229.79</td><td>4.35</td><td>0.03</td></tr><tr><td>topologicalSort</td><td>192.07</td><td>5.21</td><td>0.03</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>heap</span></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add & pop</td><td>4.69</td><td>213.13</td><td>1.63e-4</td></tr><tr><td>10,000 fib add & pop</td><td>367.49</td><td>2.72</td><td>0.01</td></tr></table></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 add & pop</td><td>4.67</td><td>214.00</td><td>7.34e-5</td></tr><tr><td>10,000 fib add & pop</td><td>370.25</td><td>2.70</td><td>0.00</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>doubly-linked-list</span></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 unshift</td><td>221.10</td><td>4.52</td><td>0.06</td></tr><tr><td>1,000,000 unshift & shift</td><td>179.99</td><td>5.56</td><td>0.03</td></tr><tr><td>1,000,000 insertBefore</td><td>331.29</td><td>3.02</td><td>0.06</td></tr></table></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 unshift</td><td>208.21</td><td>4.80</td><td>0.03</td></tr><tr><td>1,000,000 unshift & shift</td><td>172.47</td><td>5.80</td><td>0.03</td></tr><tr><td>1,000,000 insertBefore</td><td>319.07</td><td>3.13</td><td>0.07</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>singly-linked-list</span></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 push & pop</td><td>216.59</td><td>4.62</td><td>0.01</td></tr><tr><td>10,000 insertBefore</td><td>255.08</td><td>3.92</td><td>0.01</td></tr></table></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 push & pop</td><td>222.14</td><td>4.50</td><td>0.01</td></tr><tr><td>10,000 insertBefore</td><td>246.45</td><td>4.06</td><td>0.01</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>max-priority-queue</span></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 refill & poll</td><td>12.00</td><td>83.34</td><td>6.62e-4</td></tr></table></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>10,000 refill & poll</td><td>11.61</td><td>86.10</td><td>2.55e-4</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>deque</span></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>222.01</td><td>4.50</td><td>0.05</td></tr><tr><td>1,000,000 shift</td><td>25.35</td><td>39.45</td><td>0.00</td></tr></table></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>219.76</td><td>4.55</td><td>0.05</td></tr><tr><td>1,000,000 shift</td><td>25.57</td><td>39.10</td><td>0.00</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>queue</span></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>45.31</td><td>22.07</td><td>0.01</td></tr><tr><td>1,000,000 push & shift</td><td>83.92</td><td>11.92</td><td>0.01</td></tr></table></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>1,000,000 push</td><td>46.20</td><td>21.64</td><td>0.01</td></tr><tr><td>1,000,000 push & shift</td><td>93.60</td><td>10.68</td><td>0.01</td></tr></table></div>
</div><div class="json-to-html-collapse clearfix 0">
<div class='collapsible level0' ><span class='json-to-html-label'>trie</span></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>100,000 push</td><td>59.08</td><td>16.92</td><td>0.01</td></tr><tr><td>100,000 getWords</td><td>95.74</td><td>10.44</td><td>0.01</td></tr></table></div>
<div class="content"><table style="display: table; width:100%; table-layout: fixed;"><tr><th>test name</th><th>time taken (ms)</th><th>executions per sec</th><th>sample deviation</th></tr><tr><td>100,000 push</td><td>57.94</td><td>17.26</td><td>0.01</td></tr><tr><td>100,000 getWords</td><td>118.45</td><td>8.44</td><td>0.03</td></tr></table></div>
</div>
[//]: # (No deletion!!! End of Replace Section)
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-structure-typed",
"version": "1.42.8",
"version": "1.42.9",
"description": "Data Structures of Javascript & TypeScript. Binary Tree, BST, Graph, Heap, Priority Queue, Linked List, Queue, Deque, Stack, AVL Tree, Tree Multiset, Trie, Directed Graph, Undirected Graph, Singly Linked List, Doubly Linked List, Max Heap, Max Priority Queue, Min Heap, Min Priority Queue.",
"main": "dist/cjs/src/index.js",
"module": "dist/mjs/src/index.js",
Expand Down
Loading

0 comments on commit fd416c5

Please sign in to comment.