data-structure-typed 1.49.6 → 1.49.7
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/CHANGELOG.md +1 -1
- package/README.md +16 -13
- package/README_zh-CN.md +2 -0
- package/benchmark/report.html +13 -13
- package/benchmark/report.json +148 -148
- package/dist/cjs/data-structures/binary-tree/avl-tree.d.ts +3 -3
- package/dist/cjs/data-structures/binary-tree/avl-tree.js +5 -5
- package/dist/cjs/data-structures/binary-tree/avl-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/binary-tree.d.ts +3 -3
- package/dist/cjs/data-structures/binary-tree/binary-tree.js +7 -9
- package/dist/cjs/data-structures/binary-tree/binary-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/bst.d.ts +3 -3
- package/dist/cjs/data-structures/binary-tree/bst.js +6 -7
- package/dist/cjs/data-structures/binary-tree/bst.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/rb-tree.d.ts +2 -2
- package/dist/cjs/data-structures/binary-tree/rb-tree.js +4 -4
- package/dist/cjs/data-structures/binary-tree/rb-tree.js.map +1 -1
- package/dist/cjs/data-structures/binary-tree/tree-multimap.d.ts +1 -1
- package/dist/cjs/data-structures/binary-tree/tree-multimap.js +3 -3
- package/dist/cjs/data-structures/binary-tree/tree-multimap.js.map +1 -1
- package/dist/cjs/data-structures/hash/hash-map.d.ts +24 -27
- package/dist/cjs/data-structures/hash/hash-map.js +35 -35
- package/dist/cjs/data-structures/hash/hash-map.js.map +1 -1
- package/dist/cjs/data-structures/hash/index.d.ts +0 -1
- package/dist/cjs/data-structures/hash/index.js +0 -1
- package/dist/cjs/data-structures/hash/index.js.map +1 -1
- package/dist/cjs/data-structures/heap/heap.d.ts +2 -1
- package/dist/cjs/data-structures/heap/heap.js +13 -13
- package/dist/cjs/data-structures/heap/heap.js.map +1 -1
- package/dist/cjs/data-structures/heap/max-heap.js +1 -1
- package/dist/cjs/data-structures/heap/max-heap.js.map +1 -1
- package/dist/cjs/data-structures/heap/min-heap.js +1 -1
- package/dist/cjs/data-structures/heap/min-heap.js.map +1 -1
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js +1 -1
- package/dist/cjs/data-structures/linked-list/doubly-linked-list.js.map +1 -1
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js +1 -3
- package/dist/cjs/data-structures/linked-list/singly-linked-list.js.map +1 -1
- package/dist/cjs/data-structures/linked-list/skip-linked-list.d.ts +2 -8
- package/dist/cjs/data-structures/linked-list/skip-linked-list.js +15 -18
- package/dist/cjs/data-structures/linked-list/skip-linked-list.js.map +1 -1
- package/dist/cjs/data-structures/matrix/matrix.d.ts +2 -7
- package/dist/cjs/data-structures/matrix/matrix.js +0 -7
- package/dist/cjs/data-structures/matrix/matrix.js.map +1 -1
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.js +1 -1
- package/dist/cjs/data-structures/priority-queue/max-priority-queue.js.map +1 -1
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.js +1 -1
- package/dist/cjs/data-structures/priority-queue/min-priority-queue.js.map +1 -1
- package/dist/cjs/data-structures/priority-queue/priority-queue.js +1 -1
- package/dist/cjs/data-structures/priority-queue/priority-queue.js.map +1 -1
- package/dist/cjs/data-structures/queue/deque.d.ts +2 -11
- package/dist/cjs/data-structures/queue/deque.js +9 -13
- package/dist/cjs/data-structures/queue/deque.js.map +1 -1
- package/dist/cjs/data-structures/queue/queue.d.ts +13 -13
- package/dist/cjs/data-structures/queue/queue.js +29 -25
- package/dist/cjs/data-structures/queue/queue.js.map +1 -1
- package/dist/cjs/data-structures/stack/stack.js +2 -3
- package/dist/cjs/data-structures/stack/stack.js.map +1 -1
- package/dist/cjs/data-structures/trie/trie.d.ts +2 -2
- package/dist/cjs/data-structures/trie/trie.js +9 -5
- package/dist/cjs/data-structures/trie/trie.js.map +1 -1
- package/dist/cjs/types/data-structures/binary-tree/binary-tree.d.ts +2 -2
- package/dist/cjs/types/data-structures/binary-tree/bst.d.ts +1 -1
- package/dist/cjs/types/data-structures/binary-tree/tree-multimap.d.ts +1 -1
- package/dist/cjs/types/data-structures/hash/hash-map.d.ts +5 -2
- package/dist/cjs/types/data-structures/hash/index.d.ts +0 -1
- package/dist/cjs/types/data-structures/hash/index.js +0 -1
- package/dist/cjs/types/data-structures/hash/index.js.map +1 -1
- package/dist/cjs/types/data-structures/heap/heap.d.ts +1 -1
- package/dist/cjs/types/data-structures/linked-list/index.d.ts +1 -0
- package/dist/cjs/types/data-structures/linked-list/index.js +1 -0
- package/dist/cjs/types/data-structures/linked-list/index.js.map +1 -1
- package/dist/cjs/types/data-structures/linked-list/skip-linked-list.d.ts +4 -1
- package/dist/cjs/types/data-structures/matrix/index.d.ts +1 -0
- package/dist/cjs/types/data-structures/matrix/index.js +1 -0
- package/dist/cjs/types/data-structures/matrix/index.js.map +1 -1
- package/dist/cjs/types/data-structures/matrix/matrix.d.ts +7 -1
- package/dist/cjs/types/data-structures/queue/deque.d.ts +3 -1
- package/dist/cjs/types/data-structures/trie/trie.d.ts +3 -1
- package/dist/mjs/data-structures/binary-tree/avl-tree.d.ts +3 -3
- package/dist/mjs/data-structures/binary-tree/avl-tree.js +5 -5
- package/dist/mjs/data-structures/binary-tree/binary-tree.d.ts +3 -3
- package/dist/mjs/data-structures/binary-tree/binary-tree.js +7 -9
- package/dist/mjs/data-structures/binary-tree/bst.d.ts +3 -3
- package/dist/mjs/data-structures/binary-tree/bst.js +6 -7
- package/dist/mjs/data-structures/binary-tree/rb-tree.d.ts +2 -2
- package/dist/mjs/data-structures/binary-tree/rb-tree.js +4 -4
- package/dist/mjs/data-structures/binary-tree/tree-multimap.d.ts +1 -1
- package/dist/mjs/data-structures/binary-tree/tree-multimap.js +3 -3
- package/dist/mjs/data-structures/hash/hash-map.d.ts +24 -27
- package/dist/mjs/data-structures/hash/hash-map.js +35 -37
- package/dist/mjs/data-structures/hash/index.d.ts +0 -1
- package/dist/mjs/data-structures/hash/index.js +0 -1
- package/dist/mjs/data-structures/heap/heap.d.ts +2 -1
- package/dist/mjs/data-structures/heap/heap.js +19 -20
- package/dist/mjs/data-structures/heap/max-heap.js +1 -1
- package/dist/mjs/data-structures/heap/min-heap.js +1 -1
- package/dist/mjs/data-structures/linked-list/doubly-linked-list.js +1 -1
- package/dist/mjs/data-structures/linked-list/singly-linked-list.js +2 -5
- package/dist/mjs/data-structures/linked-list/skip-linked-list.d.ts +2 -8
- package/dist/mjs/data-structures/linked-list/skip-linked-list.js +16 -23
- package/dist/mjs/data-structures/matrix/matrix.d.ts +2 -7
- package/dist/mjs/data-structures/matrix/matrix.js +0 -7
- package/dist/mjs/data-structures/priority-queue/max-priority-queue.js +1 -1
- package/dist/mjs/data-structures/priority-queue/min-priority-queue.js +1 -1
- package/dist/mjs/data-structures/priority-queue/priority-queue.js +1 -1
- package/dist/mjs/data-structures/queue/deque.d.ts +2 -11
- package/dist/mjs/data-structures/queue/deque.js +9 -14
- package/dist/mjs/data-structures/queue/queue.d.ts +13 -13
- package/dist/mjs/data-structures/queue/queue.js +30 -28
- package/dist/mjs/data-structures/stack/stack.js +3 -5
- package/dist/mjs/data-structures/trie/trie.d.ts +2 -2
- package/dist/mjs/data-structures/trie/trie.js +10 -9
- package/dist/mjs/types/data-structures/binary-tree/binary-tree.d.ts +2 -2
- package/dist/mjs/types/data-structures/binary-tree/bst.d.ts +1 -1
- package/dist/mjs/types/data-structures/binary-tree/tree-multimap.d.ts +1 -1
- package/dist/mjs/types/data-structures/hash/hash-map.d.ts +5 -2
- package/dist/mjs/types/data-structures/hash/index.d.ts +0 -1
- package/dist/mjs/types/data-structures/hash/index.js +0 -1
- package/dist/mjs/types/data-structures/heap/heap.d.ts +1 -1
- package/dist/mjs/types/data-structures/linked-list/index.d.ts +1 -0
- package/dist/mjs/types/data-structures/linked-list/index.js +1 -0
- package/dist/mjs/types/data-structures/linked-list/skip-linked-list.d.ts +4 -1
- package/dist/mjs/types/data-structures/matrix/index.d.ts +1 -0
- package/dist/mjs/types/data-structures/matrix/index.js +1 -0
- package/dist/mjs/types/data-structures/matrix/matrix.d.ts +7 -1
- package/dist/mjs/types/data-structures/queue/deque.d.ts +3 -1
- package/dist/mjs/types/data-structures/trie/trie.d.ts +3 -1
- package/dist/umd/data-structure-typed.js +145 -426
- package/dist/umd/data-structure-typed.min.js +2 -2
- package/dist/umd/data-structure-typed.min.js.map +1 -1
- package/package.json +1 -1
- package/src/data-structures/binary-tree/avl-tree.ts +4 -4
- package/src/data-structures/binary-tree/binary-tree.ts +6 -10
- package/src/data-structures/binary-tree/bst.ts +5 -7
- package/src/data-structures/binary-tree/rb-tree.ts +3 -3
- package/src/data-structures/binary-tree/tree-multimap.ts +2 -2
- package/src/data-structures/hash/hash-map.ts +46 -50
- package/src/data-structures/hash/index.ts +0 -1
- package/src/data-structures/heap/heap.ts +20 -19
- package/src/data-structures/heap/max-heap.ts +1 -1
- package/src/data-structures/heap/min-heap.ts +1 -1
- package/src/data-structures/linked-list/doubly-linked-list.ts +1 -1
- package/src/data-structures/linked-list/singly-linked-list.ts +2 -5
- package/src/data-structures/linked-list/skip-linked-list.ts +15 -16
- package/src/data-structures/matrix/matrix.ts +2 -10
- package/src/data-structures/priority-queue/max-priority-queue.ts +1 -1
- package/src/data-structures/priority-queue/min-priority-queue.ts +1 -1
- package/src/data-structures/priority-queue/priority-queue.ts +1 -1
- package/src/data-structures/queue/deque.ts +11 -15
- package/src/data-structures/queue/queue.ts +29 -28
- package/src/data-structures/stack/stack.ts +3 -6
- package/src/data-structures/trie/trie.ts +10 -11
- package/src/types/data-structures/binary-tree/binary-tree.ts +2 -2
- package/src/types/data-structures/binary-tree/bst.ts +1 -1
- package/src/types/data-structures/binary-tree/tree-multimap.ts +1 -1
- package/src/types/data-structures/hash/hash-map.ts +6 -2
- package/src/types/data-structures/hash/index.ts +0 -1
- package/src/types/data-structures/heap/heap.ts +1 -1
- package/src/types/data-structures/linked-list/index.ts +1 -0
- package/src/types/data-structures/linked-list/skip-linked-list.ts +1 -1
- package/src/types/data-structures/matrix/index.ts +1 -0
- package/src/types/data-structures/matrix/matrix.ts +7 -1
- package/src/types/data-structures/queue/deque.ts +1 -1
- package/src/types/data-structures/trie/trie.ts +1 -1
- package/test/unit/data-structures/linked-list/skip-list.test.ts +1 -1
- package/test/unit/data-structures/queue/deque.test.ts +5 -5
- package/test/unit/data-structures/trie/trie.test.ts +1 -1
- package/dist/cjs/data-structures/hash/hash-table.d.ts +0 -108
- package/dist/cjs/data-structures/hash/hash-table.js +0 -282
- package/dist/cjs/data-structures/hash/hash-table.js.map +0 -1
- package/dist/cjs/types/data-structures/hash/hash-table.d.ts +0 -1
- package/dist/cjs/types/data-structures/hash/hash-table.js +0 -3
- package/dist/cjs/types/data-structures/hash/hash-table.js.map +0 -1
- package/dist/cjs/types/data-structures/matrix/matrix2d.d.ts +0 -1
- package/dist/cjs/types/data-structures/matrix/matrix2d.js +0 -3
- package/dist/cjs/types/data-structures/matrix/matrix2d.js.map +0 -1
- package/dist/cjs/types/data-structures/matrix/vector2d.d.ts +0 -1
- package/dist/cjs/types/data-structures/matrix/vector2d.js +0 -3
- package/dist/cjs/types/data-structures/matrix/vector2d.js.map +0 -1
- package/dist/mjs/data-structures/hash/hash-table.d.ts +0 -108
- package/dist/mjs/data-structures/hash/hash-table.js +0 -283
- package/dist/mjs/types/data-structures/hash/hash-table.d.ts +0 -1
- package/dist/mjs/types/data-structures/hash/hash-table.js +0 -1
- package/dist/mjs/types/data-structures/matrix/matrix2d.d.ts +0 -1
- package/dist/mjs/types/data-structures/matrix/matrix2d.js +0 -1
- package/dist/mjs/types/data-structures/matrix/vector2d.d.ts +0 -1
- package/dist/mjs/types/data-structures/matrix/vector2d.js +0 -1
- package/src/data-structures/hash/hash-table.ts +0 -318
- package/src/types/data-structures/hash/hash-table.ts +0 -1
- package/src/types/data-structures/matrix/matrix2d.ts +0 -1
- package/src/types/data-structures/matrix/vector2d.ts +0 -1
- package/test/unit/data-structures/hash/hash-table.test.ts +0 -238
package/benchmark/report.json
CHANGED
|
@@ -3,27 +3,27 @@
|
|
|
3
3
|
"benchmarks": [
|
|
4
4
|
{
|
|
5
5
|
"test name": "10,000 add randomly",
|
|
6
|
-
"time taken (ms)": "
|
|
7
|
-
"executions per sec": "
|
|
8
|
-
"sample deviation": "0.
|
|
6
|
+
"time taken (ms)": "126.82",
|
|
7
|
+
"executions per sec": "7.88",
|
|
8
|
+
"sample deviation": "0.01"
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
"test name": "10,000 add & delete randomly",
|
|
12
|
-
"time taken (ms)": "
|
|
13
|
-
"executions per sec": "5.
|
|
12
|
+
"time taken (ms)": "186.36",
|
|
13
|
+
"executions per sec": "5.37",
|
|
14
14
|
"sample deviation": "0.00"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"test name": "10,000 addMany",
|
|
18
|
-
"time taken (ms)": "
|
|
19
|
-
"executions per sec": "7.
|
|
18
|
+
"time taken (ms)": "133.15",
|
|
19
|
+
"executions per sec": "7.51",
|
|
20
20
|
"sample deviation": "0.00"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"test name": "10,000 get",
|
|
24
|
-
"time taken (ms)": "
|
|
25
|
-
"executions per sec": "19.
|
|
26
|
-
"sample deviation": "
|
|
24
|
+
"time taken (ms)": "50.65",
|
|
25
|
+
"executions per sec": "19.74",
|
|
26
|
+
"sample deviation": "5.59e-4"
|
|
27
27
|
}
|
|
28
28
|
],
|
|
29
29
|
"testName": "avl-tree"
|
|
@@ -32,39 +32,39 @@
|
|
|
32
32
|
"benchmarks": [
|
|
33
33
|
{
|
|
34
34
|
"test name": "10,000 RBTree add",
|
|
35
|
-
"time taken (ms)": "
|
|
36
|
-
"executions per sec": "
|
|
37
|
-
"sample deviation": "
|
|
35
|
+
"time taken (ms)": "6.12",
|
|
36
|
+
"executions per sec": "163.48",
|
|
37
|
+
"sample deviation": "1.94e-4"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
"test name": "10,000 RBTree add & delete randomly",
|
|
41
|
-
"time taken (ms)": "15.
|
|
42
|
-
"executions per sec": "
|
|
43
|
-
"sample deviation": "
|
|
41
|
+
"time taken (ms)": "15.46",
|
|
42
|
+
"executions per sec": "64.70",
|
|
43
|
+
"sample deviation": "3.64e-4"
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
"test name": "10,000 RBTree get",
|
|
47
|
-
"time taken (ms)": "
|
|
48
|
-
"executions per sec": "
|
|
49
|
-
"sample deviation": "
|
|
47
|
+
"time taken (ms)": "19.98",
|
|
48
|
+
"executions per sec": "50.06",
|
|
49
|
+
"sample deviation": "0.00"
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
"test name": "10,000 AVLTree add",
|
|
53
|
-
"time taken (ms)": "
|
|
54
|
-
"executions per sec": "7.
|
|
55
|
-
"sample deviation": "0.
|
|
53
|
+
"time taken (ms)": "130.40",
|
|
54
|
+
"executions per sec": "7.67",
|
|
55
|
+
"sample deviation": "0.02"
|
|
56
56
|
},
|
|
57
57
|
{
|
|
58
58
|
"test name": "10,000 AVLTree add & delete randomly",
|
|
59
|
-
"time taken (ms)": "
|
|
60
|
-
"executions per sec": "5.
|
|
61
|
-
"sample deviation": "0.
|
|
59
|
+
"time taken (ms)": "193.64",
|
|
60
|
+
"executions per sec": "5.16",
|
|
61
|
+
"sample deviation": "0.01"
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
"test name": "10,000 AVLTree get",
|
|
65
|
-
"time taken (ms)": "0.
|
|
66
|
-
"executions per sec": "
|
|
67
|
-
"sample deviation": "
|
|
65
|
+
"time taken (ms)": "0.99",
|
|
66
|
+
"executions per sec": "1005.44",
|
|
67
|
+
"sample deviation": "3.95e-5"
|
|
68
68
|
}
|
|
69
69
|
],
|
|
70
70
|
"testName": "binary-tree-overall"
|
|
@@ -73,27 +73,27 @@
|
|
|
73
73
|
"benchmarks": [
|
|
74
74
|
{
|
|
75
75
|
"test name": "100,000 add",
|
|
76
|
-
"time taken (ms)": "
|
|
77
|
-
"executions per sec": "
|
|
78
|
-
"sample deviation": "0.
|
|
76
|
+
"time taken (ms)": "90.72",
|
|
77
|
+
"executions per sec": "11.02",
|
|
78
|
+
"sample deviation": "0.03"
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
"test name": "100,000 add & delete randomly",
|
|
82
|
-
"time taken (ms)": "
|
|
83
|
-
"executions per sec": "4.
|
|
84
|
-
"sample deviation": "0.
|
|
82
|
+
"time taken (ms)": "228.77",
|
|
83
|
+
"executions per sec": "4.37",
|
|
84
|
+
"sample deviation": "0.02"
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
"test name": "100,000 getNode",
|
|
88
|
-
"time taken (ms)": "
|
|
89
|
-
"executions per sec": "5.
|
|
90
|
-
"sample deviation": "
|
|
88
|
+
"time taken (ms)": "192.25",
|
|
89
|
+
"executions per sec": "5.20",
|
|
90
|
+
"sample deviation": "5.16e-4"
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
"test name": "100,000 add & iterator",
|
|
94
|
-
"time taken (ms)": "
|
|
95
|
-
"executions per sec": "
|
|
96
|
-
"sample deviation": "0.
|
|
94
|
+
"time taken (ms)": "112.49",
|
|
95
|
+
"executions per sec": "8.89",
|
|
96
|
+
"sample deviation": "0.01"
|
|
97
97
|
}
|
|
98
98
|
],
|
|
99
99
|
"testName": "rb-tree"
|
|
@@ -102,44 +102,44 @@
|
|
|
102
102
|
"benchmarks": [
|
|
103
103
|
{
|
|
104
104
|
"test name": "1,000 addVertex",
|
|
105
|
-
"time taken (ms)": "0.
|
|
106
|
-
"executions per sec": "
|
|
107
|
-
"sample deviation": "1.
|
|
105
|
+
"time taken (ms)": "0.11",
|
|
106
|
+
"executions per sec": "9250.94",
|
|
107
|
+
"sample deviation": "1.22e-5"
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
110
|
"test name": "1,000 addEdge",
|
|
111
|
-
"time taken (ms)": "6.
|
|
112
|
-
"executions per sec": "
|
|
113
|
-
"sample deviation": "
|
|
111
|
+
"time taken (ms)": "6.35",
|
|
112
|
+
"executions per sec": "157.51",
|
|
113
|
+
"sample deviation": "2.88e-4"
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
116
|
"test name": "1,000 getVertex",
|
|
117
117
|
"time taken (ms)": "0.05",
|
|
118
|
-
"executions per sec": "2.
|
|
119
|
-
"sample deviation": "
|
|
118
|
+
"executions per sec": "2.06e+4",
|
|
119
|
+
"sample deviation": "8.69e-6"
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
"test name": "1,000 getEdge",
|
|
123
|
-
"time taken (ms)": "23.
|
|
124
|
-
"executions per sec": "
|
|
123
|
+
"time taken (ms)": "23.02",
|
|
124
|
+
"executions per sec": "43.43",
|
|
125
125
|
"sample deviation": "0.00"
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
"test name": "tarjan",
|
|
129
|
-
"time taken (ms)": "
|
|
130
|
-
"executions per sec": "4.
|
|
129
|
+
"time taken (ms)": "213.85",
|
|
130
|
+
"executions per sec": "4.68",
|
|
131
131
|
"sample deviation": "0.01"
|
|
132
132
|
},
|
|
133
133
|
{
|
|
134
134
|
"test name": "tarjan all",
|
|
135
|
-
"time taken (ms)": "
|
|
135
|
+
"time taken (ms)": "6674.11",
|
|
136
136
|
"executions per sec": "0.15",
|
|
137
|
-
"sample deviation": "0.
|
|
137
|
+
"sample deviation": "0.28"
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
140
|
"test name": "topologicalSort",
|
|
141
|
-
"time taken (ms)": "
|
|
142
|
-
"executions per sec": "5.
|
|
141
|
+
"time taken (ms)": "179.09",
|
|
142
|
+
"executions per sec": "5.58",
|
|
143
143
|
"sample deviation": "0.00"
|
|
144
144
|
}
|
|
145
145
|
],
|
|
@@ -149,56 +149,56 @@
|
|
|
149
149
|
"benchmarks": [
|
|
150
150
|
{
|
|
151
151
|
"test name": "1,000,000 set",
|
|
152
|
-
"time taken (ms)": "
|
|
153
|
-
"executions per sec": "
|
|
154
|
-
"sample deviation": "0.
|
|
152
|
+
"time taken (ms)": "131.27",
|
|
153
|
+
"executions per sec": "7.62",
|
|
154
|
+
"sample deviation": "0.05"
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
157
|
"test name": "Native Map 1,000,000 set",
|
|
158
|
-
"time taken (ms)": "
|
|
159
|
-
"executions per sec": "
|
|
160
|
-
"sample deviation": "0.
|
|
158
|
+
"time taken (ms)": "267.34",
|
|
159
|
+
"executions per sec": "3.74",
|
|
160
|
+
"sample deviation": "0.04"
|
|
161
161
|
},
|
|
162
162
|
{
|
|
163
163
|
"test name": "Native Set 1,000,000 add",
|
|
164
|
-
"time taken (ms)": "
|
|
165
|
-
"executions per sec": "
|
|
166
|
-
"sample deviation": "0.
|
|
164
|
+
"time taken (ms)": "207.03",
|
|
165
|
+
"executions per sec": "4.83",
|
|
166
|
+
"sample deviation": "0.06"
|
|
167
167
|
},
|
|
168
168
|
{
|
|
169
169
|
"test name": "1,000,000 set & get",
|
|
170
|
-
"time taken (ms)": "
|
|
171
|
-
"executions per sec": "
|
|
172
|
-
"sample deviation": "0.
|
|
170
|
+
"time taken (ms)": "132.19",
|
|
171
|
+
"executions per sec": "7.56",
|
|
172
|
+
"sample deviation": "0.03"
|
|
173
173
|
},
|
|
174
174
|
{
|
|
175
175
|
"test name": "Native Map 1,000,000 set & get",
|
|
176
|
-
"time taken (ms)": "
|
|
177
|
-
"executions per sec": "3.
|
|
176
|
+
"time taken (ms)": "276.30",
|
|
177
|
+
"executions per sec": "3.62",
|
|
178
178
|
"sample deviation": "0.01"
|
|
179
179
|
},
|
|
180
180
|
{
|
|
181
181
|
"test name": "Native Set 1,000,000 add & has",
|
|
182
|
-
"time taken (ms)": "
|
|
183
|
-
"executions per sec": "5.
|
|
182
|
+
"time taken (ms)": "187.74",
|
|
183
|
+
"executions per sec": "5.33",
|
|
184
184
|
"sample deviation": "0.02"
|
|
185
185
|
},
|
|
186
186
|
{
|
|
187
187
|
"test name": "1,000,000 ObjKey set & get",
|
|
188
|
-
"time taken (ms)": "
|
|
189
|
-
"executions per sec": "2.
|
|
190
|
-
"sample deviation": "0.
|
|
188
|
+
"time taken (ms)": "336.39",
|
|
189
|
+
"executions per sec": "2.97",
|
|
190
|
+
"sample deviation": "0.03"
|
|
191
191
|
},
|
|
192
192
|
{
|
|
193
193
|
"test name": "Native Map 1,000,000 ObjKey set & get",
|
|
194
|
-
"time taken (ms)": "
|
|
195
|
-
"executions per sec": "2.
|
|
196
|
-
"sample deviation": "0.
|
|
194
|
+
"time taken (ms)": "394.47",
|
|
195
|
+
"executions per sec": "2.54",
|
|
196
|
+
"sample deviation": "0.09"
|
|
197
197
|
},
|
|
198
198
|
{
|
|
199
199
|
"test name": "Native Set 1,000,000 ObjKey add & has",
|
|
200
|
-
"time taken (ms)": "
|
|
201
|
-
"executions per sec": "3.
|
|
200
|
+
"time taken (ms)": "295.48",
|
|
201
|
+
"executions per sec": "3.38",
|
|
202
202
|
"sample deviation": "0.04"
|
|
203
203
|
}
|
|
204
204
|
],
|
|
@@ -208,20 +208,20 @@
|
|
|
208
208
|
"benchmarks": [
|
|
209
209
|
{
|
|
210
210
|
"test name": "100,000 add & poll",
|
|
211
|
-
"time taken (ms)": "
|
|
212
|
-
"executions per sec": "
|
|
213
|
-
"sample deviation": "
|
|
211
|
+
"time taken (ms)": "24.18",
|
|
212
|
+
"executions per sec": "41.35",
|
|
213
|
+
"sample deviation": "6.43e-4"
|
|
214
214
|
},
|
|
215
215
|
{
|
|
216
216
|
"test name": "100,000 add & dfs",
|
|
217
|
-
"time taken (ms)": "
|
|
218
|
-
"executions per sec": "29.
|
|
219
|
-
"sample deviation": "
|
|
217
|
+
"time taken (ms)": "33.64",
|
|
218
|
+
"executions per sec": "29.72",
|
|
219
|
+
"sample deviation": "0.00"
|
|
220
220
|
},
|
|
221
221
|
{
|
|
222
222
|
"test name": "10,000 fib add & pop",
|
|
223
|
-
"time taken (ms)": "
|
|
224
|
-
"executions per sec": "2.
|
|
223
|
+
"time taken (ms)": "363.38",
|
|
224
|
+
"executions per sec": "2.75",
|
|
225
225
|
"sample deviation": "0.00"
|
|
226
226
|
}
|
|
227
227
|
],
|
|
@@ -231,27 +231,27 @@
|
|
|
231
231
|
"benchmarks": [
|
|
232
232
|
{
|
|
233
233
|
"test name": "1,000,000 push",
|
|
234
|
-
"time taken (ms)": "
|
|
235
|
-
"executions per sec": "4.
|
|
234
|
+
"time taken (ms)": "220.16",
|
|
235
|
+
"executions per sec": "4.54",
|
|
236
236
|
"sample deviation": "0.03"
|
|
237
237
|
},
|
|
238
238
|
{
|
|
239
239
|
"test name": "1,000,000 unshift",
|
|
240
|
-
"time taken (ms)": "
|
|
241
|
-
"executions per sec": "4.
|
|
242
|
-
"sample deviation": "0.
|
|
240
|
+
"time taken (ms)": "210.84",
|
|
241
|
+
"executions per sec": "4.74",
|
|
242
|
+
"sample deviation": "0.05"
|
|
243
243
|
},
|
|
244
244
|
{
|
|
245
245
|
"test name": "1,000,000 unshift & shift",
|
|
246
|
-
"time taken (ms)": "
|
|
247
|
-
"executions per sec": "5.
|
|
248
|
-
"sample deviation": "0.
|
|
246
|
+
"time taken (ms)": "189.59",
|
|
247
|
+
"executions per sec": "5.27",
|
|
248
|
+
"sample deviation": "0.07"
|
|
249
249
|
},
|
|
250
250
|
{
|
|
251
251
|
"test name": "1,000,000 addBefore",
|
|
252
|
-
"time taken (ms)": "
|
|
253
|
-
"executions per sec": "2.
|
|
254
|
-
"sample deviation": "0.
|
|
252
|
+
"time taken (ms)": "412.74",
|
|
253
|
+
"executions per sec": "2.42",
|
|
254
|
+
"sample deviation": "0.17"
|
|
255
255
|
}
|
|
256
256
|
],
|
|
257
257
|
"testName": "doubly-linked-list"
|
|
@@ -260,20 +260,20 @@
|
|
|
260
260
|
"benchmarks": [
|
|
261
261
|
{
|
|
262
262
|
"test name": "1,000,000 push & shift",
|
|
263
|
-
"time taken (ms)": "
|
|
264
|
-
"executions per sec": "
|
|
265
|
-
"sample deviation": "0.
|
|
263
|
+
"time taken (ms)": "252.06",
|
|
264
|
+
"executions per sec": "3.97",
|
|
265
|
+
"sample deviation": "0.09"
|
|
266
266
|
},
|
|
267
267
|
{
|
|
268
268
|
"test name": "10,000 push & pop",
|
|
269
|
-
"time taken (ms)": "
|
|
270
|
-
"executions per sec": "4.
|
|
269
|
+
"time taken (ms)": "230.29",
|
|
270
|
+
"executions per sec": "4.34",
|
|
271
271
|
"sample deviation": "0.01"
|
|
272
272
|
},
|
|
273
273
|
{
|
|
274
274
|
"test name": "10,000 addBefore",
|
|
275
|
-
"time taken (ms)": "
|
|
276
|
-
"executions per sec": "3.
|
|
275
|
+
"time taken (ms)": "261.57",
|
|
276
|
+
"executions per sec": "3.82",
|
|
277
277
|
"sample deviation": "0.01"
|
|
278
278
|
}
|
|
279
279
|
],
|
|
@@ -283,9 +283,9 @@
|
|
|
283
283
|
"benchmarks": [
|
|
284
284
|
{
|
|
285
285
|
"test name": "100,000 add & poll",
|
|
286
|
-
"time taken (ms)": "
|
|
287
|
-
"executions per sec": "
|
|
288
|
-
"sample deviation": "
|
|
286
|
+
"time taken (ms)": "75.71",
|
|
287
|
+
"executions per sec": "13.21",
|
|
288
|
+
"sample deviation": "8.95e-4"
|
|
289
289
|
}
|
|
290
290
|
],
|
|
291
291
|
"testName": "priority-queue"
|
|
@@ -294,39 +294,39 @@
|
|
|
294
294
|
"benchmarks": [
|
|
295
295
|
{
|
|
296
296
|
"test name": "1,000,000 push",
|
|
297
|
-
"time taken (ms)": "
|
|
298
|
-
"executions per sec": "
|
|
299
|
-
"sample deviation": "
|
|
297
|
+
"time taken (ms)": "25.18",
|
|
298
|
+
"executions per sec": "39.71",
|
|
299
|
+
"sample deviation": "0.01"
|
|
300
300
|
},
|
|
301
301
|
{
|
|
302
302
|
"test name": "1,000,000 push & pop",
|
|
303
|
-
"time taken (ms)": "
|
|
304
|
-
"executions per sec": "
|
|
305
|
-
"sample deviation": "
|
|
303
|
+
"time taken (ms)": "33.52",
|
|
304
|
+
"executions per sec": "29.83",
|
|
305
|
+
"sample deviation": "0.01"
|
|
306
306
|
},
|
|
307
307
|
{
|
|
308
308
|
"test name": "100,000 push & shift",
|
|
309
|
-
"time taken (ms)": "
|
|
310
|
-
"executions per sec": "
|
|
311
|
-
"sample deviation": "
|
|
309
|
+
"time taken (ms)": "3.61",
|
|
310
|
+
"executions per sec": "276.96",
|
|
311
|
+
"sample deviation": "5.50e-4"
|
|
312
312
|
},
|
|
313
313
|
{
|
|
314
314
|
"test name": "Native Array 100,000 push & shift",
|
|
315
|
-
"time taken (ms)": "
|
|
316
|
-
"executions per sec": "0.
|
|
317
|
-
"sample deviation": "0.
|
|
315
|
+
"time taken (ms)": "2703.16",
|
|
316
|
+
"executions per sec": "0.37",
|
|
317
|
+
"sample deviation": "0.11"
|
|
318
318
|
},
|
|
319
319
|
{
|
|
320
320
|
"test name": "100,000 unshift & shift",
|
|
321
|
-
"time taken (ms)": "
|
|
322
|
-
"executions per sec": "
|
|
323
|
-
"sample deviation": "
|
|
321
|
+
"time taken (ms)": "3.73",
|
|
322
|
+
"executions per sec": "268.14",
|
|
323
|
+
"sample deviation": "8.29e-4"
|
|
324
324
|
},
|
|
325
325
|
{
|
|
326
326
|
"test name": "Native Array 100,000 unshift & shift",
|
|
327
|
-
"time taken (ms)": "
|
|
328
|
-
"executions per sec": "0.
|
|
329
|
-
"sample deviation": "0.
|
|
327
|
+
"time taken (ms)": "4767.61",
|
|
328
|
+
"executions per sec": "0.21",
|
|
329
|
+
"sample deviation": "0.40"
|
|
330
330
|
}
|
|
331
331
|
],
|
|
332
332
|
"testName": "deque"
|
|
@@ -335,27 +335,27 @@
|
|
|
335
335
|
"benchmarks": [
|
|
336
336
|
{
|
|
337
337
|
"test name": "1,000,000 push",
|
|
338
|
-
"time taken (ms)": "
|
|
339
|
-
"executions per sec": "
|
|
338
|
+
"time taken (ms)": "50.56",
|
|
339
|
+
"executions per sec": "19.78",
|
|
340
340
|
"sample deviation": "0.01"
|
|
341
341
|
},
|
|
342
342
|
{
|
|
343
343
|
"test name": "100,000 push & shift",
|
|
344
|
-
"time taken (ms)": "5.
|
|
345
|
-
"executions per sec": "
|
|
346
|
-
"sample deviation": "
|
|
344
|
+
"time taken (ms)": "5.99",
|
|
345
|
+
"executions per sec": "166.85",
|
|
346
|
+
"sample deviation": "0.00"
|
|
347
347
|
},
|
|
348
348
|
{
|
|
349
349
|
"test name": "Native Array 100,000 push & shift",
|
|
350
|
-
"time taken (ms)": "
|
|
351
|
-
"executions per sec": "0.
|
|
352
|
-
"sample deviation": "0.
|
|
350
|
+
"time taken (ms)": "2962.43",
|
|
351
|
+
"executions per sec": "0.34",
|
|
352
|
+
"sample deviation": "0.29"
|
|
353
353
|
},
|
|
354
354
|
{
|
|
355
355
|
"test name": "Native Array 100,000 push & pop",
|
|
356
|
-
"time taken (ms)": "4.
|
|
357
|
-
"executions per sec": "
|
|
358
|
-
"sample deviation": "
|
|
356
|
+
"time taken (ms)": "4.49",
|
|
357
|
+
"executions per sec": "222.69",
|
|
358
|
+
"sample deviation": "3.01e-4"
|
|
359
359
|
}
|
|
360
360
|
],
|
|
361
361
|
"testName": "queue"
|
|
@@ -364,14 +364,14 @@
|
|
|
364
364
|
"benchmarks": [
|
|
365
365
|
{
|
|
366
366
|
"test name": "1,000,000 push",
|
|
367
|
-
"time taken (ms)": "
|
|
368
|
-
"executions per sec": "
|
|
369
|
-
"sample deviation": "0.
|
|
367
|
+
"time taken (ms)": "59.68",
|
|
368
|
+
"executions per sec": "16.76",
|
|
369
|
+
"sample deviation": "0.03"
|
|
370
370
|
},
|
|
371
371
|
{
|
|
372
372
|
"test name": "1,000,000 push & pop",
|
|
373
|
-
"time taken (ms)": "
|
|
374
|
-
"executions per sec": "19.
|
|
373
|
+
"time taken (ms)": "52.04",
|
|
374
|
+
"executions per sec": "19.22",
|
|
375
375
|
"sample deviation": "0.01"
|
|
376
376
|
}
|
|
377
377
|
],
|
|
@@ -381,14 +381,14 @@
|
|
|
381
381
|
"benchmarks": [
|
|
382
382
|
{
|
|
383
383
|
"test name": "100,000 push",
|
|
384
|
-
"time taken (ms)": "
|
|
385
|
-
"executions per sec": "
|
|
386
|
-
"sample deviation": "
|
|
384
|
+
"time taken (ms)": "47.70",
|
|
385
|
+
"executions per sec": "20.96",
|
|
386
|
+
"sample deviation": "0.00"
|
|
387
387
|
},
|
|
388
388
|
{
|
|
389
389
|
"test name": "100,000 getWords",
|
|
390
|
-
"time taken (ms)": "
|
|
391
|
-
"executions per sec": "
|
|
390
|
+
"time taken (ms)": "66.53",
|
|
391
|
+
"executions per sec": "15.03",
|
|
392
392
|
"sample deviation": "0.00"
|
|
393
393
|
}
|
|
394
394
|
],
|
|
@@ -23,15 +23,15 @@ export declare class AVLTreeNode<K = any, V = any, N extends AVLTreeNode<K, V, N
|
|
|
23
23
|
*/
|
|
24
24
|
export declare class AVLTree<K = any, V = any, N extends AVLTreeNode<K, V, N> = AVLTreeNode<K, V, AVLTreeNodeNested<K, V>>, TREE extends AVLTree<K, V, N, TREE> = AVLTree<K, V, N, AVLTreeNested<K, V, N>>> extends BST<K, V, N, TREE> implements IBinaryTree<K, V, N, TREE> {
|
|
25
25
|
/**
|
|
26
|
-
* The constructor function initializes an AVLTree object with optional
|
|
27
|
-
* @param [
|
|
26
|
+
* The constructor function initializes an AVLTree object with optional keysOrNodesOrEntries and options.
|
|
27
|
+
* @param [keysOrNodesOrEntries] - The `keysOrNodesOrEntries` parameter is an optional iterable of `KeyOrNodeOrEntry<K, V, N>`
|
|
28
28
|
* objects. It represents a collection of nodes that will be added to the AVL tree during
|
|
29
29
|
* initialization.
|
|
30
30
|
* @param [options] - The `options` parameter is an optional object that allows you to customize the
|
|
31
31
|
* behavior of the AVL tree. It is of type `Partial<AVLTreeOptions>`, which means that you can
|
|
32
32
|
* provide only a subset of the properties defined in the `AVLTreeOptions` interface.
|
|
33
33
|
*/
|
|
34
|
-
constructor(
|
|
34
|
+
constructor(keysOrNodesOrEntries?: Iterable<KeyOrNodeOrEntry<K, V, N>>, options?: AVLTreeOptions<K>);
|
|
35
35
|
/**
|
|
36
36
|
* The function creates a new AVL tree node with the specified key and value.
|
|
37
37
|
* @param {K} key - The key parameter is the key value that will be associated with
|
|
@@ -27,18 +27,18 @@ exports.AVLTreeNode = AVLTreeNode;
|
|
|
27
27
|
*/
|
|
28
28
|
class AVLTree extends bst_1.BST {
|
|
29
29
|
/**
|
|
30
|
-
* The constructor function initializes an AVLTree object with optional
|
|
31
|
-
* @param [
|
|
30
|
+
* The constructor function initializes an AVLTree object with optional keysOrNodesOrEntries and options.
|
|
31
|
+
* @param [keysOrNodesOrEntries] - The `keysOrNodesOrEntries` parameter is an optional iterable of `KeyOrNodeOrEntry<K, V, N>`
|
|
32
32
|
* objects. It represents a collection of nodes that will be added to the AVL tree during
|
|
33
33
|
* initialization.
|
|
34
34
|
* @param [options] - The `options` parameter is an optional object that allows you to customize the
|
|
35
35
|
* behavior of the AVL tree. It is of type `Partial<AVLTreeOptions>`, which means that you can
|
|
36
36
|
* provide only a subset of the properties defined in the `AVLTreeOptions` interface.
|
|
37
37
|
*/
|
|
38
|
-
constructor(
|
|
38
|
+
constructor(keysOrNodesOrEntries = [], options) {
|
|
39
39
|
super([], options);
|
|
40
|
-
if (
|
|
41
|
-
super.addMany(
|
|
40
|
+
if (keysOrNodesOrEntries)
|
|
41
|
+
super.addMany(keysOrNodesOrEntries);
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
* The function creates a new AVL tree node with the specified key and value.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avl-tree.js","sourceRoot":"","sources":["../../../../src/data-structures/binary-tree/avl-tree.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,+BAAqC;AAYrC,MAAa,WAAwF,SAAQ,aAI5G;IAGC,YAAY,GAAM,EAAE,KAAS;QAC3B,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAClB,CAAC;CACF;AAXD,kCAWC;AAED;;;;;;;;GAQG;AACH,MAAa,OAMX,SAAQ,SAAkB;IAE1B;;;;;;;;OAQG;IACH,YAAY,
|
|
1
|
+
{"version":3,"file":"avl-tree.js","sourceRoot":"","sources":["../../../../src/data-structures/binary-tree/avl-tree.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,+BAAqC;AAYrC,MAAa,WAAwF,SAAQ,aAI5G;IAGC,YAAY,GAAM,EAAE,KAAS;QAC3B,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAClB,CAAC;CACF;AAXD,kCAWC;AAED;;;;;;;;GAQG;AACH,MAAa,OAMX,SAAQ,SAAkB;IAE1B;;;;;;;;OAQG;IACH,YAAY,uBAA4D,EAAE,EAAE,OAA2B;QACrG,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;QACnB,IAAI,oBAAoB;YAAE,KAAK,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;;OAQG;IACM,UAAU,CAAC,GAAM,EAAE,KAAS;QACnC,OAAO,IAAI,WAAW,CAAU,GAAG,EAAE,KAAK,CAAM,CAAC;IACnD,CAAC;IAED;;;;;;OAMG;IACM,UAAU,CAAC,OAA2B;QAC7C,OAAO,IAAI,OAAO,CAAgB,EAAE,kBAClC,aAAa,EAAE,IAAI,CAAC,aAAa,EACjC,OAAO,EAAE,IAAI,CAAC,OAAO,IAClB,OAAO,EACF,CAAC;IACb,CAAC;IAED;;;;OAIG;IACM,MAAM,CAAC,gBAA2C;QACzD,OAAO,gBAAgB,YAAY,WAAW,CAAC;IACjD,CAAC;IAED;;;;;OAKG;IACM,iBAAiB,CAAC,YAAuC;QAChE,OAAO,CAAC,CAAC,YAAY,YAAY,WAAW,CAAC,CAAC;IAChD,CAAC;IA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C,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,IAAI,CAAC;YAAE,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC;QAC7B,IAAI,CAAC;YAAE,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;QAClB,IAAI,CAAC;YAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;QAEnB,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QACtB,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC;IAES,YAAY,CAAC,OAAU,EAAE,OAAU;QAC3C,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAEhC,OAAO,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;CACF;AAhdD,0BAgdC"}
|
|
@@ -41,15 +41,15 @@ export declare class BinaryTreeNode<K = any, V = any, N extends BinaryTreeNode<K
|
|
|
41
41
|
export declare class BinaryTree<K = any, V = any, N extends BinaryTreeNode<K, V, N> = BinaryTreeNode<K, V, BinaryTreeNodeNested<K, V>>, TREE extends BinaryTree<K, V, N, TREE> = BinaryTree<K, V, N, BinaryTreeNested<K, V, N>>> extends IterableEntryBase<K, V | undefined> implements IBinaryTree<K, V, N, TREE> {
|
|
42
42
|
iterationType: IterationType;
|
|
43
43
|
/**
|
|
44
|
-
* The constructor function initializes a binary tree object with optional
|
|
45
|
-
* @param [
|
|
44
|
+
* The constructor function initializes a binary tree object with optional keysOrNodesOrEntries and options.
|
|
45
|
+
* @param [keysOrNodesOrEntries] - An optional iterable of KeyOrNodeOrEntry objects. These objects represent the
|
|
46
46
|
* nodes to be added to the binary tree.
|
|
47
47
|
* @param [options] - The `options` parameter is an optional object that can contain additional
|
|
48
48
|
* configuration options for the binary tree. In this case, it is of type
|
|
49
49
|
* `Partial<BinaryTreeOptions>`, which means that not all properties of `BinaryTreeOptions` are
|
|
50
50
|
* required.
|
|
51
51
|
*/
|
|
52
|
-
constructor(
|
|
52
|
+
constructor(keysOrNodesOrEntries?: Iterable<KeyOrNodeOrEntry<K, V, N>>, options?: BinaryTreeOptions<K>);
|
|
53
53
|
protected _extractor: (key: K) => number;
|
|
54
54
|
get extractor(): (key: K) => number;
|
|
55
55
|
protected _root?: N | null;
|