avl-tree-typed 1.38.0 → 1.38.1
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/README.md +13 -3
- package/coverage/clover.xml +5 -2
- package/coverage/coverage-final.json +95 -1
- package/coverage/coverage-summary.json +59 -2
- package/coverage/lcov-report/base.css +294 -115
- package/coverage/lcov-report/block-navigation.js +68 -68
- package/coverage/lcov-report/index.html +108 -105
- package/coverage/lcov-report/index.ts.html +76 -76
- package/coverage/lcov-report/sorter.js +183 -173
- package/dist/data-structures/binary-tree/avl-tree.d.ts +9 -9
- package/dist/data-structures/binary-tree/avl-tree.js +22 -22
- package/dist/data-structures/binary-tree/binary-tree.d.ts +31 -31
- package/dist/data-structures/binary-tree/binary-tree.js +32 -32
- package/dist/data-structures/binary-tree/rb-tree.d.ts +1 -1
- package/dist/data-structures/binary-tree/tree-multiset.d.ts +9 -9
- package/dist/data-structures/binary-tree/tree-multiset.js +23 -23
- package/dist/data-structures/hash/hash-map.d.ts +25 -25
- package/dist/data-structures/hash/hash-map.js +59 -59
- package/dist/data-structures/hash/hash-table.d.ts +34 -34
- package/dist/data-structures/hash/hash-table.js +99 -99
- package/dist/data-structures/heap/heap.d.ts +66 -66
- package/dist/data-structures/heap/heap.js +167 -167
- package/dist/data-structures/linked-list/doubly-linked-list.d.ts +1 -1
- package/dist/data-structures/linked-list/doubly-linked-list.js +3 -3
- package/dist/data-structures/linked-list/skip-linked-list.d.ts +17 -17
- package/dist/data-structures/linked-list/skip-linked-list.js +34 -34
- package/dist/data-structures/matrix/matrix2d.d.ts +7 -7
- package/dist/data-structures/matrix/matrix2d.js +9 -9
- package/dist/data-structures/trie/trie.d.ts +2 -2
- package/dist/data-structures/trie/trie.js +6 -6
- package/package.json +1 -4
- package/src/data-structures/binary-tree/avl-tree.ts +27 -27
- package/src/data-structures/binary-tree/binary-tree.ts +55 -55
- package/src/data-structures/binary-tree/bst.ts +4 -0
- package/src/data-structures/binary-tree/rb-tree.ts +2 -2
- package/src/data-structures/binary-tree/tree-multiset.ts +29 -29
- package/src/data-structures/hash/hash-map.ts +81 -75
- package/src/data-structures/hash/hash-table.ts +112 -109
- package/src/data-structures/heap/heap.ts +182 -181
- package/src/data-structures/linked-list/doubly-linked-list.ts +4 -4
- package/src/data-structures/linked-list/skip-linked-list.ts +45 -38
- package/src/data-structures/matrix/matrix2d.ts +10 -10
- package/src/data-structures/trie/trie.ts +9 -9
- package/src/types/helpers.ts +5 -1
- package/test/index.test.ts +78 -78
- package/tsconfig.json +1 -2
package/README.md
CHANGED
|
@@ -7,25 +7,35 @@
|
|
|
7
7
|

|
|
8
8
|
|
|
9
9
|
# What
|
|
10
|
+
|
|
10
11
|
## Brief
|
|
11
|
-
This is a standalone AVL Tree data structure from the data-structure-typed collection. If you wish to access more data structures or advanced features, you can transition to directly installing the complete [data-structure-typed](https://www.npmjs.com/package/data-structure-typed) package
|
|
12
12
|
|
|
13
|
+
This is a standalone AVL Tree data structure from the data-structure-typed collection. If you wish to access more data
|
|
14
|
+
structures or advanced features, you can transition to directly installing the
|
|
15
|
+
complete [data-structure-typed](https://www.npmjs.com/package/data-structure-typed) package
|
|
13
16
|
|
|
14
17
|
# How
|
|
15
18
|
|
|
16
19
|
## install
|
|
20
|
+
|
|
17
21
|
### npm
|
|
22
|
+
|
|
18
23
|
```bash
|
|
19
24
|
npm i avl-tree-typed --save
|
|
20
25
|
```
|
|
26
|
+
|
|
21
27
|
### yarn
|
|
28
|
+
|
|
22
29
|
```bash
|
|
23
30
|
yarn add avl-tree-typed
|
|
24
31
|
```
|
|
32
|
+
|
|
25
33
|
### methods
|
|
34
|
+
|
|
26
35
|

|
|
27
36
|
|
|
28
37
|
### snippet
|
|
38
|
+
|
|
29
39
|
#### TS
|
|
30
40
|
|
|
31
41
|
```typescript
|
|
@@ -124,7 +134,9 @@ lastBFSIds[0] // 12
|
|
|
124
134
|
const lastBFSNodes = avlTree.BFS('node');
|
|
125
135
|
lastBFSNodes[0].id // 12
|
|
126
136
|
```
|
|
137
|
+
|
|
127
138
|
#### JS
|
|
139
|
+
|
|
128
140
|
```javascript
|
|
129
141
|
const {AVLTree} = require('data-structure-typed');
|
|
130
142
|
// /* or if you prefer */ const {AVLTree} = require('avl-tree-typed');
|
|
@@ -222,7 +234,6 @@ const lastBFSNodes = avlTree.BFS('node');
|
|
|
222
234
|
lastBFSNodes[0].id // 12
|
|
223
235
|
```
|
|
224
236
|
|
|
225
|
-
|
|
226
237
|
## API docs & Examples
|
|
227
238
|
|
|
228
239
|
[API Docs](https://data-structure-typed-docs.vercel.app)
|
|
@@ -424,7 +435,6 @@ lastBFSNodes[0].id // 12
|
|
|
424
435
|
</tbody>
|
|
425
436
|
</table>
|
|
426
437
|
|
|
427
|
-
|
|
428
438
|
# Why
|
|
429
439
|
|
|
430
440
|
## Complexities
|
package/coverage/clover.xml
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<coverage generated="1696760515685" clover="3.2.0">
|
|
3
3
|
<project timestamp="1696760515685" name="All files">
|
|
4
|
-
<metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="2"
|
|
4
|
+
<metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="2"
|
|
5
|
+
coveredmethods="1" elements="3" coveredelements="2" complexity="0" loc="1" ncloc="1" packages="1" files="1"
|
|
6
|
+
classes="1"/>
|
|
5
7
|
<file name="index.ts" path="/Users/revone/projects/data-structure-typed-individuals/avl-tree-typed/src/index.ts">
|
|
6
|
-
<metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="2"
|
|
8
|
+
<metrics statements="1" coveredstatements="1" conditionals="0" coveredconditionals="0" methods="2"
|
|
9
|
+
coveredmethods="1"/>
|
|
7
10
|
<line num="8" count="2" type="stmt"/>
|
|
8
11
|
</file>
|
|
9
12
|
</project>
|
|
@@ -1,2 +1,96 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"/Users/revone/projects/data-structure-typed-individuals/avl-tree-typed/src/index.ts": {
|
|
3
|
+
"path": "/Users/revone/projects/data-structure-typed-individuals/avl-tree-typed/src/index.ts",
|
|
4
|
+
"statementMap": {
|
|
5
|
+
"0": {
|
|
6
|
+
"start": {
|
|
7
|
+
"line": 8,
|
|
8
|
+
"column": 0
|
|
9
|
+
},
|
|
10
|
+
"end": {
|
|
11
|
+
"line": 8,
|
|
12
|
+
"column": 9
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"1": {
|
|
16
|
+
"start": {
|
|
17
|
+
"line": 8,
|
|
18
|
+
"column": 9
|
|
19
|
+
},
|
|
20
|
+
"end": {
|
|
21
|
+
"line": 8,
|
|
22
|
+
"column": 22
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"2": {
|
|
26
|
+
"start": {
|
|
27
|
+
"line": 8,
|
|
28
|
+
"column": 22
|
|
29
|
+
},
|
|
30
|
+
"end": {
|
|
31
|
+
"line": 8,
|
|
32
|
+
"column": 60
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"fnMap": {
|
|
37
|
+
"0": {
|
|
38
|
+
"name": "(anonymous_0)",
|
|
39
|
+
"decl": {
|
|
40
|
+
"start": {
|
|
41
|
+
"line": 8,
|
|
42
|
+
"column": 9
|
|
43
|
+
},
|
|
44
|
+
"end": {
|
|
45
|
+
"line": 8,
|
|
46
|
+
"column": 20
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"loc": {
|
|
50
|
+
"start": {
|
|
51
|
+
"line": 8,
|
|
52
|
+
"column": 9
|
|
53
|
+
},
|
|
54
|
+
"end": {
|
|
55
|
+
"line": 8,
|
|
56
|
+
"column": 22
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"1": {
|
|
61
|
+
"name": "(anonymous_1)",
|
|
62
|
+
"decl": {
|
|
63
|
+
"start": {
|
|
64
|
+
"line": 8,
|
|
65
|
+
"column": 22
|
|
66
|
+
},
|
|
67
|
+
"end": {
|
|
68
|
+
"line": 8,
|
|
69
|
+
"column": 29
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"loc": {
|
|
73
|
+
"start": {
|
|
74
|
+
"line": 8,
|
|
75
|
+
"column": 22
|
|
76
|
+
},
|
|
77
|
+
"end": {
|
|
78
|
+
"line": 8,
|
|
79
|
+
"column": 60
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"branchMap": {},
|
|
85
|
+
"s": {
|
|
86
|
+
"0": 1,
|
|
87
|
+
"1": 1,
|
|
88
|
+
"2": 2
|
|
89
|
+
},
|
|
90
|
+
"f": {
|
|
91
|
+
"0": 0,
|
|
92
|
+
"1": 1
|
|
93
|
+
},
|
|
94
|
+
"b": {}
|
|
95
|
+
}
|
|
2
96
|
}
|
|
@@ -1,3 +1,60 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
1
|
+
{
|
|
2
|
+
"total": {
|
|
3
|
+
"lines": {
|
|
4
|
+
"total": 1,
|
|
5
|
+
"covered": 1,
|
|
6
|
+
"skipped": 0,
|
|
7
|
+
"pct": 100
|
|
8
|
+
},
|
|
9
|
+
"statements": {
|
|
10
|
+
"total": 3,
|
|
11
|
+
"covered": 3,
|
|
12
|
+
"skipped": 0,
|
|
13
|
+
"pct": 100
|
|
14
|
+
},
|
|
15
|
+
"functions": {
|
|
16
|
+
"total": 2,
|
|
17
|
+
"covered": 1,
|
|
18
|
+
"skipped": 0,
|
|
19
|
+
"pct": 50
|
|
20
|
+
},
|
|
21
|
+
"branches": {
|
|
22
|
+
"total": 0,
|
|
23
|
+
"covered": 0,
|
|
24
|
+
"skipped": 0,
|
|
25
|
+
"pct": 100
|
|
26
|
+
},
|
|
27
|
+
"branchesTrue": {
|
|
28
|
+
"total": 0,
|
|
29
|
+
"covered": 0,
|
|
30
|
+
"skipped": 0,
|
|
31
|
+
"pct": "Unknown"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"/Users/revone/projects/data-structure-typed-individuals/avl-tree-typed/src/index.ts": {
|
|
35
|
+
"lines": {
|
|
36
|
+
"total": 1,
|
|
37
|
+
"covered": 1,
|
|
38
|
+
"skipped": 0,
|
|
39
|
+
"pct": 100
|
|
40
|
+
},
|
|
41
|
+
"functions": {
|
|
42
|
+
"total": 2,
|
|
43
|
+
"covered": 1,
|
|
44
|
+
"skipped": 0,
|
|
45
|
+
"pct": 50
|
|
46
|
+
},
|
|
47
|
+
"statements": {
|
|
48
|
+
"total": 3,
|
|
49
|
+
"covered": 3,
|
|
50
|
+
"skipped": 0,
|
|
51
|
+
"pct": 100
|
|
52
|
+
},
|
|
53
|
+
"branches": {
|
|
54
|
+
"total": 0,
|
|
55
|
+
"covered": 0,
|
|
56
|
+
"skipped": 0,
|
|
57
|
+
"pct": 100
|
|
58
|
+
}
|
|
59
|
+
}
|
|
3
60
|
}
|