mirror of
https://github.com/zrwusa/data-structure-typed.git
synced 2024-11-23 04:44:04 +00:00
release: 1.51.8
This commit is contained in:
parent
0013242189
commit
3c26538c2e
|
@ -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.51.7](https://github.com/zrwusa/data-structure-typed/compare/v1.51.5...main) (upcoming)
|
||||
## [v1.51.8](https://github.com/zrwusa/data-structure-typed/compare/v1.51.5...main) (upcoming)
|
||||
|
||||
## [v1.51.5](https://github.com/zrwusa/data-structure-typed/compare/v1.35.0...v1.51.5) (18 January 2024)
|
||||
|
||||
|
|
26
README.md
26
README.md
|
@ -736,43 +736,43 @@ Version 11.7.9
|
|||
[//]: # (No deletion!!! Start of Replace Section)
|
||||
<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>100,000 add</td><td>6.42</td><td>155.78</td><td>1.88e-4</td></tr><tr><td>100,000 add & poll</td><td>31.60</td><td>31.65</td><td>9.13e-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>100,000 add</td><td>6.34</td><td>157.78</td><td>1.90e-4</td></tr><tr><td>100,000 add & poll</td><td>31.39</td><td>31.86</td><td>8.18e-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</td><td>59.28</td><td>16.87</td><td>7.81e-4</td></tr><tr><td>100,000 add randomly</td><td>71.61</td><td>13.96</td><td>9.02e-4</td></tr><tr><td>100,000 get</td><td>104.13</td><td>9.60</td><td>0.00</td></tr><tr><td>100,000 iterator</td><td>27.03</td><td>37.00</td><td>0.00</td></tr><tr><td>100,000 add & delete orderly</td><td>126.42</td><td>7.91</td><td>0.00</td></tr><tr><td>100,000 add & delete randomly</td><td>214.36</td><td>4.66</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</td><td>59.64</td><td>16.77</td><td>0.00</td></tr><tr><td>100,000 add randomly</td><td>73.67</td><td>13.57</td><td>0.00</td></tr><tr><td>100,000 get</td><td>89.91</td><td>11.12</td><td>0.00</td></tr><tr><td>100,000 iterator</td><td>26.08</td><td>38.34</td><td>0.00</td></tr><tr><td>100,000 add & delete orderly</td><td>145.44</td><td>6.88</td><td>0.00</td></tr><tr><td>100,000 add & delete randomly</td><td>204.81</td><td>4.88</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>44.98</td><td>22.23</td><td>0.01</td></tr><tr><td>100,000 push & shift</td><td>4.89</td><td>204.39</td><td>6.15e-4</td></tr><tr><td>Native JS Array 100,000 push & shift</td><td>2251.13</td><td>0.44</td><td>0.26</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>40.84</td><td>24.48</td><td>0.00</td></tr><tr><td>100,000 push & shift</td><td>4.83</td><td>207.16</td><td>5.59e-4</td></tr><tr><td>Native JS Array 100,000 push & shift</td><td>2376.78</td><td>0.42</td><td>0.34</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>22.21</td><td>45.02</td><td>0.00</td></tr><tr><td>1,000,000 push & pop</td><td>30.97</td><td>32.29</td><td>0.00</td></tr><tr><td>1,000,000 push & shift</td><td>30.81</td><td>32.46</td><td>0.00</td></tr><tr><td>100,000 push & shift</td><td>3.24</td><td>308.25</td><td>2.08e-4</td></tr><tr><td>Native JS Array 100,000 push & shift</td><td>2279.95</td><td>0.44</td><td>0.21</td></tr><tr><td>100,000 unshift & shift</td><td>2.93</td><td>341.78</td><td>3.21e-4</td></tr><tr><td>Native JS Array 100,000 unshift & shift</td><td>4076.04</td><td>0.25</td><td>0.42</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>24.73</td><td>40.44</td><td>0.00</td></tr><tr><td>1,000,000 push & pop</td><td>30.08</td><td>33.24</td><td>0.00</td></tr><tr><td>1,000,000 push & shift</td><td>30.53</td><td>32.75</td><td>0.00</td></tr><tr><td>100,000 push & shift</td><td>3.19</td><td>313.76</td><td>3.01e-4</td></tr><tr><td>Native JS Array 100,000 push & shift</td><td>2184.78</td><td>0.46</td><td>0.19</td></tr><tr><td>100,000 unshift & shift</td><td>2.94</td><td>339.72</td><td>3.66e-4</td></tr><tr><td>Native JS Array 100,000 unshift & shift</td><td>4196.69</td><td>0.24</td><td>0.37</td></tr></table></div>
|
||||
</div><div class="json-to-html-collapse clearfix 0">
|
||||
<div class='collapsible level0' ><span class='json-to-html-label'>hash-map</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 set</td><td>118.11</td><td>8.47</td><td>0.02</td></tr><tr><td>Native JS Map 1,000,000 set</td><td>206.18</td><td>4.85</td><td>0.01</td></tr><tr><td>Native JS Set 1,000,000 add</td><td>167.50</td><td>5.97</td><td>0.01</td></tr><tr><td>1,000,000 set & get</td><td>116.15</td><td>8.61</td><td>0.01</td></tr><tr><td>Native JS Map 1,000,000 set & get</td><td>269.11</td><td>3.72</td><td>0.02</td></tr><tr><td>Native JS Set 1,000,000 add & has</td><td>168.02</td><td>5.95</td><td>0.01</td></tr><tr><td>1,000,000 ObjKey set & get</td><td>335.36</td><td>2.98</td><td>0.04</td></tr><tr><td>Native JS Map 1,000,000 ObjKey set & get</td><td>327.78</td><td>3.05</td><td>0.06</td></tr><tr><td>Native JS Set 1,000,000 ObjKey add & has</td><td>281.64</td><td>3.55</td><td>0.04</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 set</td><td>117.77</td><td>8.49</td><td>0.03</td></tr><tr><td>Native JS Map 1,000,000 set</td><td>200.53</td><td>4.99</td><td>0.00</td></tr><tr><td>Native JS Set 1,000,000 add</td><td>172.75</td><td>5.79</td><td>0.03</td></tr><tr><td>1,000,000 set & get</td><td>117.61</td><td>8.50</td><td>0.02</td></tr><tr><td>Native JS Map 1,000,000 set & get</td><td>265.24</td><td>3.77</td><td>0.01</td></tr><tr><td>Native JS Set 1,000,000 add & has</td><td>168.61</td><td>5.93</td><td>0.01</td></tr><tr><td>1,000,000 ObjKey set & get</td><td>325.91</td><td>3.07</td><td>0.04</td></tr><tr><td>Native JS Map 1,000,000 ObjKey set & get</td><td>301.51</td><td>3.32</td><td>0.03</td></tr><tr><td>Native JS Set 1,000,000 ObjKey add & has</td><td>274.47</td><td>3.64</td><td>0.04</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>43.64</td><td>22.91</td><td>8.01e-4</td></tr><tr><td>100,000 getWords</td><td>82.95</td><td>12.06</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 push</td><td>42.93</td><td>23.29</td><td>8.30e-4</td></tr><tr><td>100,000 getWords</td><td>82.14</td><td>12.17</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'>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>100,000 add</td><td>263.01</td><td>3.80</td><td>0.02</td></tr><tr><td>100,000 add randomly</td><td>353.89</td><td>2.83</td><td>0.01</td></tr><tr><td>100,000 get</td><td>131.65</td><td>7.60</td><td>0.00</td></tr><tr><td>100,000 iterator</td><td>31.62</td><td>31.63</td><td>0.01</td></tr><tr><td>100,000 add & delete orderly</td><td>468.81</td><td>2.13</td><td>0.00</td></tr><tr><td>100,000 add & delete randomly</td><td>628.30</td><td>1.59</td><td>0.03</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</td><td>231.62</td><td>4.32</td><td>0.00</td></tr><tr><td>100,000 add randomly</td><td>304.23</td><td>3.29</td><td>0.00</td></tr><tr><td>100,000 get</td><td>113.93</td><td>8.78</td><td>0.00</td></tr><tr><td>100,000 iterator</td><td>30.37</td><td>32.92</td><td>0.00</td></tr><tr><td>100,000 add & delete orderly</td><td>395.02</td><td>2.53</td><td>0.02</td></tr><tr><td>100,000 add & delete randomly</td><td>542.16</td><td>1.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'>binary-tree-overall</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 RBTree add randomly</td><td>5.79</td><td>172.73</td><td>7.35e-5</td></tr><tr><td>10,000 RBTree get randomly</td><td>9.58</td><td>104.37</td><td>9.96e-5</td></tr><tr><td>10,000 RBTree add & delete randomly</td><td>17.82</td><td>56.12</td><td>1.90e-4</td></tr><tr><td>10,000 AVLTree add randomly</td><td>27.85</td><td>35.91</td><td>3.16e-4</td></tr><tr><td>10,000 AVLTree get randomly</td><td>10.73</td><td>93.19</td><td>6.38e-5</td></tr><tr><td>10,000 AVLTree add & delete randomly</td><td>48.98</td><td>20.42</td><td>3.91e-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 RBTree add randomly</td><td>6.02</td><td>166.10</td><td>9.19e-5</td></tr><tr><td>10,000 RBTree get randomly</td><td>7.96</td><td>125.61</td><td>7.80e-5</td></tr><tr><td>10,000 RBTree add & delete randomly</td><td>16.66</td><td>60.02</td><td>1.52e-4</td></tr><tr><td>10,000 AVLTree add randomly</td><td>21.64</td><td>46.21</td><td>1.93e-4</td></tr><tr><td>10,000 AVLTree get randomly</td><td>8.40</td><td>119.09</td><td>1.34e-4</td></tr><tr><td>10,000 AVLTree add & delete randomly</td><td>40.84</td><td>24.49</td><td>2.56e-4</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>9624.60</td><td>7.61e-7</td></tr><tr><td>1,000 addEdge</td><td>6.02</td><td>166.18</td><td>1.45e-4</td></tr><tr><td>1,000 getVertex</td><td>0.05</td><td>2.17e+4</td><td>3.52e-7</td></tr><tr><td>1,000 getEdge</td><td>23.88</td><td>41.88</td><td>0.00</td></tr><tr><td>tarjan</td><td>215.08</td><td>4.65</td><td>0.01</td></tr><tr><td>topologicalSort</td><td>187.83</td><td>5.32</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 addVertex</td><td>0.10</td><td>9892.74</td><td>8.38e-7</td></tr><tr><td>1,000 addEdge</td><td>6.07</td><td>164.74</td><td>1.70e-4</td></tr><tr><td>1,000 getVertex</td><td>0.05</td><td>2.13e+4</td><td>2.16e-6</td></tr><tr><td>1,000 getEdge</td><td>38.66</td><td>25.87</td><td>0.02</td></tr><tr><td>tarjan</td><td>208.11</td><td>4.81</td><td>0.01</td></tr><tr><td>topologicalSort</td><td>184.45</td><td>5.42</td><td>0.02</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 push</td><td>221.69</td><td>4.51</td><td>0.03</td></tr><tr><td>1,000,000 unshift</td><td>227.33</td><td>4.40</td><td>0.07</td></tr><tr><td>1,000,000 unshift & shift</td><td>170.08</td><td>5.88</td><td>0.02</td></tr><tr><td>1,000,000 addBefore</td><td>321.29</td><td>3.11</td><td>0.07</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>218.49</td><td>4.58</td><td>0.04</td></tr><tr><td>1,000,000 unshift</td><td>213.52</td><td>4.68</td><td>0.06</td></tr><tr><td>1,000,000 unshift & shift</td><td>155.82</td><td>6.42</td><td>0.02</td></tr><tr><td>1,000,000 addBefore</td><td>325.79</td><td>3.07</td><td>0.08</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>1,000,000 push & shift</td><td>213.14</td><td>4.69</td><td>0.04</td></tr><tr><td>10,000 push & pop</td><td>217.84</td><td>4.59</td><td>0.01</td></tr><tr><td>10,000 addBefore</td><td>250.81</td><td>3.99</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 & shift</td><td>191.94</td><td>5.21</td><td>0.04</td></tr><tr><td>10,000 push & pop</td><td>214.82</td><td>4.66</td><td>0.01</td></tr><tr><td>10,000 addBefore</td><td>247.53</td><td>4.04</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'>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>100,000 add</td><td>26.91</td><td>37.16</td><td>1.96e-4</td></tr><tr><td>100,000 add & poll</td><td>75.09</td><td>13.32</td><td>5.04e-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>100,000 add</td><td>26.63</td><td>37.56</td><td>1.30e-4</td></tr><tr><td>100,000 add & poll</td><td>76.82</td><td>13.02</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'>stack</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>39.92</td><td>25.05</td><td>0.01</td></tr><tr><td>1,000,000 push & pop</td><td>48.08</td><td>20.80</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>38.58</td><td>25.92</td><td>0.00</td></tr><tr><td>1,000,000 push & pop</td><td>46.06</td><td>21.71</td><td>0.00</td></tr></table></div>
|
||||
</div>
|
||||
|
||||
[//]: # (No deletion!!! End of Replace Section)
|
||||
|
|
52
package-lock.json
generated
52
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "data-structure-typed",
|
||||
"version": "1.51.7",
|
||||
"version": "1.51.8",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "data-structure-typed",
|
||||
"version": "1.51.7",
|
||||
"version": "1.51.8",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@swc/core": "^1.3.96",
|
||||
|
@ -16,11 +16,11 @@
|
|||
"@typescript-eslint/eslint-plugin": "^6.7.4",
|
||||
"@typescript-eslint/parser": "^6.7.4",
|
||||
"auto-changelog": "^2.4.0",
|
||||
"avl-tree-typed": "^1.51.6",
|
||||
"avl-tree-typed": "^1.51.7",
|
||||
"benchmark": "^2.1.4",
|
||||
"binary-tree-typed": "^1.51.6",
|
||||
"bst-typed": "^1.51.5",
|
||||
"data-structure-typed": "^1.51.6",
|
||||
"binary-tree-typed": "^1.51.7",
|
||||
"bst-typed": "^1.51.7",
|
||||
"data-structure-typed": "^1.51.7",
|
||||
"dependency-cruiser": "^14.1.0",
|
||||
"doctoc": "^2.2.1",
|
||||
"eslint": "^8.50.0",
|
||||
|
@ -29,7 +29,7 @@
|
|||
"eslint-import-resolver-typescript": "^3.6.1",
|
||||
"eslint-plugin-import": "^2.28.1",
|
||||
"fast-glob": "^3.3.1",
|
||||
"heap-typed": "^1.51.5",
|
||||
"heap-typed": "^1.51.7",
|
||||
"istanbul-badges-readme": "^1.8.5",
|
||||
"jest": "^29.7.0",
|
||||
"js-sdsl": "^4.4.2",
|
||||
|
@ -3097,12 +3097,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/avl-tree-typed": {
|
||||
"version": "1.51.6",
|
||||
"resolved": "https://registry.npmjs.org/avl-tree-typed/-/avl-tree-typed-1.51.6.tgz",
|
||||
"integrity": "sha512-4nUw06qxBXPsjU26yzQo75ehQAGKaT3Tk8ffuFWcK7pwvsE+ZMDg2aD6bif5BZotjcexH9vgAfakEOzUYSwtGA==",
|
||||
"version": "1.51.7",
|
||||
"resolved": "https://registry.npmjs.org/avl-tree-typed/-/avl-tree-typed-1.51.7.tgz",
|
||||
"integrity": "sha512-7ylhTBu3u26sTqTOxp+JiypGc9Rwv6S3eVL2dDDuXFRMIMZR1BUwgjT3VnF3B3EM/cLulVJ6DeEiT13OodZcCA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"data-structure-typed": "^1.51.6"
|
||||
"data-structure-typed": "^1.51.7"
|
||||
}
|
||||
},
|
||||
"node_modules/babel-jest": {
|
||||
|
@ -3306,12 +3306,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/binary-tree-typed": {
|
||||
"version": "1.51.6",
|
||||
"resolved": "https://registry.npmjs.org/binary-tree-typed/-/binary-tree-typed-1.51.6.tgz",
|
||||
"integrity": "sha512-l/qEKAjYbsYMZUDP5x3Imo477qFUkpJdZR8cKZTEJWor9S+29lCZ7EUHH+60S7jpY3Y+jD11F3N0hCW4u0EnLw==",
|
||||
"version": "1.51.7",
|
||||
"resolved": "https://registry.npmjs.org/binary-tree-typed/-/binary-tree-typed-1.51.7.tgz",
|
||||
"integrity": "sha512-oYFgefTymWz2N2dbTJYGkJXCjai7whlUaonfjVImqYElx41v7vcP2rAt+CxUcwUJdKRNDI70UtWpmpDd1pESrg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"data-structure-typed": "^1.51.6"
|
||||
"data-structure-typed": "^1.51.7"
|
||||
}
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
|
@ -3390,12 +3390,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/bst-typed": {
|
||||
"version": "1.51.5",
|
||||
"resolved": "https://registry.npmjs.org/bst-typed/-/bst-typed-1.51.5.tgz",
|
||||
"integrity": "sha512-HmpA3D4WmPBcWIbJMSTJ2wLPwwfl9ulNXJyuSIYGFLZoTa9+g1oA4HRL43IUnBCLgVWSXsq7Bhc/Jp1jvN/84w==",
|
||||
"version": "1.51.7",
|
||||
"resolved": "https://registry.npmjs.org/bst-typed/-/bst-typed-1.51.7.tgz",
|
||||
"integrity": "sha512-PoYbsvbyndqhwVwDx3AzATPaRo0KGm8mxapz0oonv7Ahg0RoAvOAL3w8+LxioGNFI9rfbYnDL33IjdxFyDpWew==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"data-structure-typed": "^1.51.5"
|
||||
"data-structure-typed": "^1.51.7"
|
||||
}
|
||||
},
|
||||
"node_modules/buffer-from": {
|
||||
|
@ -3838,9 +3838,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/data-structure-typed": {
|
||||
"version": "1.51.6",
|
||||
"resolved": "https://registry.npmjs.org/data-structure-typed/-/data-structure-typed-1.51.6.tgz",
|
||||
"integrity": "sha512-yGWn77EAQWkg2LbegmpTrgk1Vf2RjY6y17ePTPXOCTkxLYBPrV0jS7MFUDYRuSMSRohSSnoM/3GZuzMcc1iXOw==",
|
||||
"version": "1.51.7",
|
||||
"resolved": "https://registry.npmjs.org/data-structure-typed/-/data-structure-typed-1.51.7.tgz",
|
||||
"integrity": "sha512-JiR6SYZi0hgojPdojTLGeSHzLL/v0ppIqzB168FGWje6dUbS1P4+/80T6cFPukjIfatHvnm+7L3Z11E4XXSUdg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/debug": {
|
||||
|
@ -5363,12 +5363,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/heap-typed": {
|
||||
"version": "1.51.5",
|
||||
"resolved": "https://registry.npmjs.org/heap-typed/-/heap-typed-1.51.5.tgz",
|
||||
"integrity": "sha512-mCD9etfviFYdbDEkXJWTyKVX7f2LPRCQHHLjo+VOsE+IBJRTScuNIJKSD+HKZOntNBCWW0VWdc+ZzkXEKU2mhw==",
|
||||
"version": "1.51.7",
|
||||
"resolved": "https://registry.npmjs.org/heap-typed/-/heap-typed-1.51.7.tgz",
|
||||
"integrity": "sha512-afq4w+3kDff5Axdt4ZsS4tTMKFb7sCRblk0+8vmGRNQcJ8wHnZIdTEmXmHY5xVLq/84lSayMgct7hyKp8II0LA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"data-structure-typed": "^1.51.5"
|
||||
"data-structure-typed": "^1.51.7"
|
||||
}
|
||||
},
|
||||
"node_modules/html-escaper": {
|
||||
|
|
12
package.json
12
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "data-structure-typed",
|
||||
"version": "1.51.7",
|
||||
"version": "1.51.8",
|
||||
"description": "Javascript Data Structure. Heap, Binary Tree, Red Black 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. Benchmark compared with C++ STL. API aligned with ES6 and Java.util. Usability is comparable to Python",
|
||||
"main": "dist/cjs/index.js",
|
||||
"module": "dist/mjs/index.js",
|
||||
|
@ -66,11 +66,11 @@
|
|||
"@typescript-eslint/eslint-plugin": "^6.7.4",
|
||||
"@typescript-eslint/parser": "^6.7.4",
|
||||
"auto-changelog": "^2.4.0",
|
||||
"avl-tree-typed": "^1.51.6",
|
||||
"avl-tree-typed": "^1.51.7",
|
||||
"benchmark": "^2.1.4",
|
||||
"binary-tree-typed": "^1.51.6",
|
||||
"bst-typed": "^1.51.5",
|
||||
"data-structure-typed": "^1.51.6",
|
||||
"binary-tree-typed": "^1.51.7",
|
||||
"bst-typed": "^1.51.7",
|
||||
"data-structure-typed": "^1.51.7",
|
||||
"dependency-cruiser": "^14.1.0",
|
||||
"doctoc": "^2.2.1",
|
||||
"eslint": "^8.50.0",
|
||||
|
@ -79,7 +79,7 @@
|
|||
"eslint-import-resolver-typescript": "^3.6.1",
|
||||
"eslint-plugin-import": "^2.28.1",
|
||||
"fast-glob": "^3.3.1",
|
||||
"heap-typed": "^1.51.5",
|
||||
"heap-typed": "^1.51.7",
|
||||
"istanbul-badges-readme": "^1.8.5",
|
||||
"jest": "^29.7.0",
|
||||
"js-sdsl": "^4.4.2",
|
||||
|
|
|
@ -149,7 +149,7 @@ export class BinaryTree<
|
|||
* `Partial<BinaryTreeOptions>`, which means that not all properties of `BinaryTreeOptions` are
|
||||
* required.
|
||||
*/
|
||||
constructor(keysOrNodesOrEntries: Iterable<KeyOrNodeOrEntry<K, V, NODE>> = [], options?: BinaryTreeOptions<K>) {
|
||||
constructor(keysOrNodesOrEntries: Iterable<KeyOrNodeOrEntry<K, V, NODE>> = [], options?: BinaryTreeOptions) {
|
||||
super();
|
||||
if (options) {
|
||||
const { iterationType } = options;
|
||||
|
@ -209,7 +209,7 @@ export class BinaryTree<
|
|||
* you can provide only a subset of the properties defined in the `BinaryTreeOptions` interface.
|
||||
* @returns a new instance of a binary tree.
|
||||
*/
|
||||
createTree(options?: Partial<BinaryTreeOptions<K>>): TREE {
|
||||
createTree(options?: Partial<BinaryTreeOptions>): TREE {
|
||||
return new BinaryTree<K, V, NODE, TREE>([], { iterationType: this.iterationType, ...options }) as TREE;
|
||||
}
|
||||
|
||||
|
@ -1831,10 +1831,10 @@ export class BinaryTree<
|
|||
console.log(`U for undefined
|
||||
`);
|
||||
if (opts.isShowNull)
|
||||
console.log(`NODE for null
|
||||
console.log(`N for null
|
||||
`);
|
||||
if (opts.isShowRedBlackNIL)
|
||||
console.log(`S for Sentinel Node
|
||||
console.log(`S for Sentinel Node(NIL)
|
||||
`);
|
||||
|
||||
const display = (root: NODE | null | undefined): void => {
|
||||
|
|
|
@ -17,7 +17,7 @@ export interface IBinaryTree<
|
|||
> {
|
||||
createNode(key: K, value?: N['value']): N;
|
||||
|
||||
createTree(options?: Partial<BinaryTreeOptions<K>>): TREE;
|
||||
createTree(options?: Partial<BinaryTreeOptions>): TREE;
|
||||
|
||||
add(keyOrNodeOrEntry: KeyOrNodeOrEntry<K, V, N>, value?: V, count?: number): boolean;
|
||||
|
||||
|
|
|
@ -6,6 +6,6 @@ export type BinaryTreeNodeNested<K extends Comparable, V> = BinaryTreeNode<K, V,
|
|||
|
||||
export type BinaryTreeNested<K extends Comparable, V, NODE extends BinaryTreeNode<K, V, NODE>> = BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, BinaryTree<K, V, NODE, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
|
||||
export type BinaryTreeOptions<K> = {
|
||||
export type BinaryTreeOptions = {
|
||||
iterationType?: IterationType
|
||||
}
|
||||
|
|
|
@ -7,6 +7,6 @@ export type BSTNodeNested<K extends Comparable, V> = BSTNode<K, V, BSTNode<K, V,
|
|||
|
||||
export type BSTNested<K extends Comparable, V, N extends BSTNode<K, V, N>> = BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, BST<K, V, N, any>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
|
||||
export type BSTOptions<K> = BinaryTreeOptions<K> & {
|
||||
export type BSTOptions<K> = BinaryTreeOptions & {
|
||||
comparator?: Comparator<K>
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ describe('AVL Tree Test from data-structure-typed', () => {
|
|||
expect(subTreeSum).toBe(70);
|
||||
|
||||
let lesserSum = 0;
|
||||
tree.lesserOrGreaterTraverse(node => (lesserSum += node.key), 'LT', 10);
|
||||
tree.lesserOrGreaterTraverse(node => (lesserSum += node.key), -1, 10);
|
||||
expect(lesserSum).toBe(45);
|
||||
|
||||
// node15 has type problem. After the uniform design, the generics of containers (DirectedGraph, BST) are based on the type of value. However, this design has a drawback: when I attempt to inherit from the Vertex or BSTNode classes, the types of the results obtained by all methods are those of the parent class.
|
||||
|
|
|
@ -44,7 +44,7 @@ describe('AVL Tree Test', () => {
|
|||
expect(subTreeSum).toBe(70);
|
||||
|
||||
let lesserSum = 0;
|
||||
tree.lesserOrGreaterTraverse(node => (lesserSum += node.key), -1, 10);
|
||||
tree.lesserOrGreaterTraverse(node => (lesserSum += node.key), 'LT', 10);
|
||||
expect(lesserSum).toBe(45);
|
||||
|
||||
// node15 has type problem. After the uniform design, the generics of containers (DirectedGraph, BST) are based on the type of value. However, this design has a drawback: when I attempt to inherit from the Vertex or BSTNode classes, the types of the results obtained by all methods are those of the parent class.
|
||||
|
|
|
@ -38,7 +38,7 @@ describe('Individual package BST operations test', () => {
|
|||
expect(subTreeSum).toBe(70);
|
||||
|
||||
let lesserSum = 0;
|
||||
bst.lesserOrGreaterTraverse(node => (lesserSum += node.key), -1, 10);
|
||||
bst.lesserOrGreaterTraverse(node => (lesserSum += node.key), 'LT', 10);
|
||||
expect(lesserSum).toBe(45);
|
||||
|
||||
expect(node15).toBeInstanceOf(BSTNode);
|
||||
|
@ -235,7 +235,7 @@ describe('Individual package BST operations test', () => {
|
|||
expect(subTreeSum).toBe(70);
|
||||
|
||||
let lesserSum = 0;
|
||||
objBST.lesserOrGreaterTraverse(node => (lesserSum += node.key), -1, 10);
|
||||
objBST.lesserOrGreaterTraverse(node => (lesserSum += node.key), 'LT', 10);
|
||||
expect(lesserSum).toBe(45);
|
||||
|
||||
expect(node15).toBeInstanceOf(BSTNode);
|
||||
|
|
|
@ -2,13 +2,12 @@ import * as Benchmark from 'benchmark';
|
|||
import * as path from 'path';
|
||||
import * as fs from 'fs';
|
||||
import * as fastGlob from 'fast-glob';
|
||||
import { Color, numberFix, render } from '../utils';
|
||||
import { ConsoleColor, numberFix, render } from '../utils';
|
||||
import { PerformanceTest } from './types';
|
||||
import * as console from 'console';
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
|
||||
const { GREEN, BOLD, END, YELLOW, GRAY, CYAN, BG_YELLOW } = Color;
|
||||
const { GREEN, BOLD, END, YELLOW, GRAY, CYAN, BG_YELLOW } = ConsoleColor;
|
||||
|
||||
const getRelativePath = (file: string) => {
|
||||
return path.relative(__dirname, file);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
export const Color = {
|
||||
export const ConsoleColor = {
|
||||
END: '\x1b[0m',
|
||||
BOLD: '\x1b[1m',
|
||||
DIM: '\x1b[2m',
|
||||
|
|
Loading…
Reference in a new issue