data-structure-typed 2.5.2 → 2.5.3
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 +3 -1
- package/MIGRATION.md +169 -0
- package/README.md +60 -6
- package/README_CN.md +551 -143
- package/SPECIFICATION.md +20 -14
- package/SPECIFICATION.zh-CN.md +20 -14
- package/dist/cjs/binary-tree.cjs +2417 -132
- package/dist/cjs/graph.cjs +248 -14
- package/dist/cjs/hash.cjs +62 -7
- package/dist/cjs/heap.cjs +103 -16
- package/dist/cjs/index.cjs +3046 -124
- package/dist/cjs/linked-list.cjs +219 -0
- package/dist/cjs/matrix.cjs +32 -0
- package/dist/cjs/priority-queue.cjs +101 -14
- package/dist/cjs/queue.cjs +215 -0
- package/dist/cjs/stack.cjs +44 -4
- package/dist/cjs/trie.cjs +44 -0
- package/dist/cjs-legacy/binary-tree.cjs +2406 -123
- package/dist/cjs-legacy/graph.cjs +248 -14
- package/dist/cjs-legacy/hash.cjs +62 -7
- package/dist/cjs-legacy/heap.cjs +103 -16
- package/dist/cjs-legacy/index.cjs +3105 -185
- package/dist/cjs-legacy/linked-list.cjs +219 -0
- package/dist/cjs-legacy/matrix.cjs +32 -0
- package/dist/cjs-legacy/priority-queue.cjs +101 -14
- package/dist/cjs-legacy/queue.cjs +215 -0
- package/dist/cjs-legacy/stack.cjs +44 -4
- package/dist/cjs-legacy/trie.cjs +44 -0
- package/dist/esm/binary-tree.mjs +2417 -132
- package/dist/esm/graph.mjs +248 -14
- package/dist/esm/hash.mjs +62 -7
- package/dist/esm/heap.mjs +103 -16
- package/dist/esm/index.mjs +3046 -124
- package/dist/esm/linked-list.mjs +219 -0
- package/dist/esm/matrix.mjs +32 -0
- package/dist/esm/priority-queue.mjs +101 -14
- package/dist/esm/queue.mjs +215 -0
- package/dist/esm/stack.mjs +44 -4
- package/dist/esm/trie.mjs +44 -0
- package/dist/esm-legacy/binary-tree.mjs +2406 -123
- package/dist/esm-legacy/graph.mjs +248 -14
- package/dist/esm-legacy/hash.mjs +62 -7
- package/dist/esm-legacy/heap.mjs +103 -16
- package/dist/esm-legacy/index.mjs +3105 -185
- package/dist/esm-legacy/linked-list.mjs +219 -0
- package/dist/esm-legacy/matrix.mjs +32 -0
- package/dist/esm-legacy/priority-queue.mjs +101 -14
- package/dist/esm-legacy/queue.mjs +215 -0
- package/dist/esm-legacy/stack.mjs +44 -4
- package/dist/esm-legacy/trie.mjs +44 -0
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +50 -2
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +56 -0
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +116 -15
- package/dist/types/data-structures/binary-tree/bst.d.ts +99 -3
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +79 -8
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +24 -0
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +520 -1
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +489 -1
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +393 -1
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +500 -1
- package/dist/types/data-structures/graph/directed-graph.d.ts +40 -0
- package/dist/types/data-structures/graph/undirected-graph.d.ts +36 -0
- package/dist/types/data-structures/hash/hash-map.d.ts +51 -6
- package/dist/types/data-structures/heap/heap.d.ts +98 -12
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +75 -0
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +61 -1
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +72 -0
- package/dist/types/data-structures/matrix/matrix.d.ts +32 -0
- package/dist/types/data-structures/queue/deque.d.ts +82 -0
- package/dist/types/data-structures/queue/queue.d.ts +61 -0
- package/dist/types/data-structures/stack/stack.d.ts +42 -2
- package/dist/types/data-structures/trie/trie.d.ts +48 -0
- package/dist/types/interfaces/binary-tree.d.ts +2 -3
- package/dist/umd/data-structure-typed.js +3105 -185
- package/dist/umd/data-structure-typed.min.js +4 -4
- package/docs-site-docusaurus/docs/api/classes/AVLTree.md +188 -200
- package/docs-site-docusaurus/docs/api/classes/AVLTreeNode.md +11 -11
- package/docs-site-docusaurus/docs/api/classes/AbstractGraph.md +62 -62
- package/docs-site-docusaurus/docs/api/classes/BST.md +183 -195
- package/docs-site-docusaurus/docs/api/classes/BSTNode.md +13 -13
- package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +15 -15
- package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +143 -155
- package/docs-site-docusaurus/docs/api/classes/BinaryTreeNode.md +13 -13
- package/docs-site-docusaurus/docs/api/classes/Deque.md +99 -85
- package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +73 -73
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +100 -70
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedListNode.md +8 -8
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +12 -12
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +1 -1
- package/docs-site-docusaurus/docs/api/classes/HashMap.md +38 -38
- package/docs-site-docusaurus/docs/api/classes/Heap.md +96 -85
- package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +25 -25
- package/docs-site-docusaurus/docs/api/classes/IterableEntryBase.md +23 -23
- package/docs-site-docusaurus/docs/api/classes/LinearBase.md +48 -48
- package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +52 -52
- package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +42 -42
- package/docs-site-docusaurus/docs/api/classes/LinkedListNode.md +6 -6
- package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +74 -74
- package/docs-site-docusaurus/docs/api/classes/MapGraph.md +73 -73
- package/docs-site-docusaurus/docs/api/classes/Matrix.md +31 -31
- package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +104 -89
- package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +104 -89
- package/docs-site-docusaurus/docs/api/classes/MinHeap.md +104 -89
- package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +104 -89
- package/docs-site-docusaurus/docs/api/classes/Navigator.md +5 -5
- package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +103 -88
- package/docs-site-docusaurus/docs/api/classes/Queue.md +111 -59
- package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +200 -212
- package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +10 -10
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +75 -75
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedListNode.md +6 -6
- package/docs-site-docusaurus/docs/api/classes/SkipList.md +37 -37
- package/docs-site-docusaurus/docs/api/classes/Stack.md +42 -42
- package/docs-site-docusaurus/docs/api/classes/TreeMap.md +107 -36
- package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +43 -43
- package/docs-site-docusaurus/docs/api/classes/TreeSet.md +106 -35
- package/docs-site-docusaurus/docs/api/classes/Trie.md +43 -43
- package/docs-site-docusaurus/docs/api/classes/TrieNode.md +8 -8
- package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +72 -72
- package/docs-site-docusaurus/docs/guide/architecture.md +75 -7
- package/docs-site-docusaurus/docs/guide/concepts.md +53 -34
- package/docs-site-docusaurus/docs/guide/faq.md +53 -0
- package/docs-site-docusaurus/docs/guide/guides.md +8 -9
- package/docs-site-docusaurus/docs/guide/integrations.md +74 -177
- package/docs-site-docusaurus/docs/guide/overview.md +131 -17
- package/docs-site-docusaurus/src/pages/index.tsx +4 -0
- package/docs-site-docusaurus/typedoc.json +1 -0
- package/package.json +7 -6
- package/src/data-structures/binary-tree/avl-tree.ts +52 -5
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +56 -0
- package/src/data-structures/binary-tree/binary-tree.ts +167 -81
- package/src/data-structures/binary-tree/bst.ts +101 -7
- package/src/data-structures/binary-tree/red-black-tree.ts +82 -15
- package/src/data-structures/binary-tree/segment-tree.ts +24 -0
- package/src/data-structures/binary-tree/tree-map.ts +540 -3
- package/src/data-structures/binary-tree/tree-multi-map.ts +490 -2
- package/src/data-structures/binary-tree/tree-multi-set.ts +393 -1
- package/src/data-structures/binary-tree/tree-set.ts +520 -3
- package/src/data-structures/graph/directed-graph.ts +41 -1
- package/src/data-structures/graph/undirected-graph.ts +37 -1
- package/src/data-structures/hash/hash-map.ts +67 -12
- package/src/data-structures/heap/heap.ts +107 -19
- package/src/data-structures/linked-list/doubly-linked-list.ts +88 -0
- package/src/data-structures/linked-list/singly-linked-list.ts +61 -1
- package/src/data-structures/linked-list/skip-linked-list.ts +72 -0
- package/src/data-structures/matrix/matrix.ts +32 -0
- package/src/data-structures/queue/deque.ts +85 -0
- package/src/data-structures/queue/queue.ts +73 -0
- package/src/data-structures/stack/stack.ts +45 -5
- package/src/data-structures/trie/trie.ts +48 -0
- package/src/interfaces/binary-tree.ts +1 -9
- package/.vitepress/cache/deps_temp_51f5f1b0/chunk-7OIKW5WK.js +0 -12984
- package/.vitepress/cache/deps_temp_51f5f1b0/package.json +0 -3
- package/.vitepress/cache/deps_temp_51f5f1b0/vitepress___@vue_devtools-api.js +0 -4505
- package/.vitepress/cache/deps_temp_51f5f1b0/vitepress___@vueuse_core.js +0 -9731
- package/.vitepress/cache/deps_temp_51f5f1b0/vue.js +0 -347
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: BinaryTreeNode\<K, V\>
|
|
8
8
|
|
|
9
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:37](https://github.com/zrwusa/data-structure-typed/blob/
|
|
9
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:37](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L37)
|
|
10
10
|
|
|
11
11
|
## Type Parameters
|
|
12
12
|
|
|
@@ -30,7 +30,7 @@ The type of the value.
|
|
|
30
30
|
new BinaryTreeNode<K, V>(key, value?): BinaryTreeNode<K, V>;
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:49](https://github.com/zrwusa/data-structure-typed/blob/
|
|
33
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:49](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L49)
|
|
34
34
|
|
|
35
35
|
Creates an instance of BinaryTreeNode.
|
|
36
36
|
|
|
@@ -66,7 +66,7 @@ Time O(1), Space O(1)
|
|
|
66
66
|
get color(): RBTNColor;
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:134](https://github.com/zrwusa/data-structure-typed/blob/
|
|
69
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:134](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L134)
|
|
70
70
|
|
|
71
71
|
Gets the color of the node (used in Red-Black trees).
|
|
72
72
|
|
|
@@ -86,7 +86,7 @@ The node's color.
|
|
|
86
86
|
set color(value): void;
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:144](https://github.com/zrwusa/data-structure-typed/blob/
|
|
89
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:144](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L144)
|
|
90
90
|
|
|
91
91
|
Sets the color of the node.
|
|
92
92
|
|
|
@@ -116,7 +116,7 @@ The new color.
|
|
|
116
116
|
get count(): number;
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:156](https://github.com/zrwusa/data-structure-typed/blob/
|
|
119
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:156](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L156)
|
|
120
120
|
|
|
121
121
|
Gets the count of nodes in the subtree rooted at this node (used in order-statistic trees).
|
|
122
122
|
|
|
@@ -136,7 +136,7 @@ The subtree node count.
|
|
|
136
136
|
set count(value): void;
|
|
137
137
|
```
|
|
138
138
|
|
|
139
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:166](https://github.com/zrwusa/data-structure-typed/blob/
|
|
139
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:166](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L166)
|
|
140
140
|
|
|
141
141
|
Sets the count of nodes in the subtree.
|
|
142
142
|
|
|
@@ -166,7 +166,7 @@ The new count.
|
|
|
166
166
|
get familyPosition(): FamilyPosition;
|
|
167
167
|
```
|
|
168
168
|
|
|
169
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:176](https://github.com/zrwusa/data-structure-typed/blob/
|
|
169
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:176](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L176)
|
|
170
170
|
|
|
171
171
|
Gets the position of the node relative to its parent.
|
|
172
172
|
|
|
@@ -190,7 +190,7 @@ The family position (e.g., 'ROOT', 'LEFT', 'RIGHT').
|
|
|
190
190
|
get height(): number;
|
|
191
191
|
```
|
|
192
192
|
|
|
193
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:112](https://github.com/zrwusa/data-structure-typed/blob/
|
|
193
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:112](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L112)
|
|
194
194
|
|
|
195
195
|
Gets the height of the node (used in self-balancing trees).
|
|
196
196
|
|
|
@@ -210,7 +210,7 @@ The height.
|
|
|
210
210
|
set height(value): void;
|
|
211
211
|
```
|
|
212
212
|
|
|
213
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:122](https://github.com/zrwusa/data-structure-typed/blob/
|
|
213
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:122](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L122)
|
|
214
214
|
|
|
215
215
|
Sets the height of the node.
|
|
216
216
|
|
|
@@ -240,7 +240,7 @@ The new height.
|
|
|
240
240
|
get left(): BinaryTreeNode<K, V> | null | undefined;
|
|
241
241
|
```
|
|
242
242
|
|
|
243
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:62](https://github.com/zrwusa/data-structure-typed/blob/
|
|
243
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:62](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L62)
|
|
244
244
|
|
|
245
245
|
Gets the left child of the node.
|
|
246
246
|
|
|
@@ -260,7 +260,7 @@ The left child.
|
|
|
260
260
|
set left(v): void;
|
|
261
261
|
```
|
|
262
262
|
|
|
263
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:72](https://github.com/zrwusa/data-structure-typed/blob/
|
|
263
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:72](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L72)
|
|
264
264
|
|
|
265
265
|
Sets the left child of the node and updates its parent reference.
|
|
266
266
|
|
|
@@ -290,7 +290,7 @@ The node to set as the left child.
|
|
|
290
290
|
get right(): BinaryTreeNode<K, V> | null | undefined;
|
|
291
291
|
```
|
|
292
292
|
|
|
293
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:87](https://github.com/zrwusa/data-structure-typed/blob/
|
|
293
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:87](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L87)
|
|
294
294
|
|
|
295
295
|
Gets the right child of the node.
|
|
296
296
|
|
|
@@ -310,7 +310,7 @@ The right child.
|
|
|
310
310
|
set right(v): void;
|
|
311
311
|
```
|
|
312
312
|
|
|
313
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:97](https://github.com/zrwusa/data-structure-typed/blob/
|
|
313
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:97](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L97)
|
|
314
314
|
|
|
315
315
|
Sets the right child of the node and updates its parent reference.
|
|
316
316
|
|