data-structure-typed 2.5.3 → 2.6.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/.github/workflows/ci.yml +7 -2
- package/.github/workflows/release-package.yml +9 -2
- package/.husky/pre-commit +3 -0
- package/CHANGELOG.md +1 -1
- package/MIGRATION.md +48 -0
- package/README.md +20 -2
- package/README_CN.md +20 -2
- package/SPECIFICATION.md +24 -0
- package/SPECIFICATION.zh-CN.md +24 -0
- package/dist/cjs/binary-tree.cjs +1897 -19
- package/dist/cjs/graph.cjs +174 -0
- package/dist/cjs/hash.cjs +33 -0
- package/dist/cjs/heap.cjs +71 -0
- package/dist/cjs/index.cjs +2383 -3
- package/dist/cjs/linked-list.cjs +224 -2
- package/dist/cjs/matrix.cjs +24 -0
- package/dist/cjs/priority-queue.cjs +71 -0
- package/dist/cjs/queue.cjs +221 -1
- package/dist/cjs/stack.cjs +59 -0
- package/dist/cjs/trie.cjs +62 -0
- package/dist/cjs-legacy/binary-tree.cjs +1897 -19
- package/dist/cjs-legacy/graph.cjs +174 -0
- package/dist/cjs-legacy/hash.cjs +33 -0
- package/dist/cjs-legacy/heap.cjs +71 -0
- package/dist/cjs-legacy/index.cjs +2383 -3
- package/dist/cjs-legacy/linked-list.cjs +224 -2
- package/dist/cjs-legacy/matrix.cjs +24 -0
- package/dist/cjs-legacy/priority-queue.cjs +71 -0
- package/dist/cjs-legacy/queue.cjs +221 -1
- package/dist/cjs-legacy/stack.cjs +59 -0
- package/dist/cjs-legacy/trie.cjs +62 -0
- package/dist/esm/binary-tree.mjs +1897 -19
- package/dist/esm/graph.mjs +174 -0
- package/dist/esm/hash.mjs +33 -0
- package/dist/esm/heap.mjs +71 -0
- package/dist/esm/index.mjs +2383 -3
- package/dist/esm/linked-list.mjs +224 -2
- package/dist/esm/matrix.mjs +24 -0
- package/dist/esm/priority-queue.mjs +71 -0
- package/dist/esm/queue.mjs +221 -1
- package/dist/esm/stack.mjs +59 -0
- package/dist/esm/trie.mjs +62 -0
- package/dist/esm-legacy/binary-tree.mjs +1897 -19
- package/dist/esm-legacy/graph.mjs +174 -0
- package/dist/esm-legacy/hash.mjs +33 -0
- package/dist/esm-legacy/heap.mjs +71 -0
- package/dist/esm-legacy/index.mjs +2383 -3
- package/dist/esm-legacy/linked-list.mjs +224 -2
- package/dist/esm-legacy/matrix.mjs +24 -0
- package/dist/esm-legacy/priority-queue.mjs +71 -0
- package/dist/esm-legacy/queue.mjs +221 -1
- package/dist/esm-legacy/stack.mjs +59 -0
- package/dist/esm-legacy/trie.mjs +62 -0
- package/dist/types/data-structures/base/iterable-element-base.d.ts +17 -0
- package/dist/types/data-structures/base/linear-base.d.ts +6 -0
- package/dist/types/data-structures/binary-tree/avl-tree.d.ts +36 -0
- package/dist/types/data-structures/binary-tree/binary-indexed-tree.d.ts +42 -0
- package/dist/types/data-structures/binary-tree/binary-tree.d.ts +75 -0
- package/dist/types/data-structures/binary-tree/bst.d.ts +72 -0
- package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +57 -0
- package/dist/types/data-structures/binary-tree/segment-tree.d.ts +18 -0
- package/dist/types/data-structures/binary-tree/tree-map.d.ts +375 -0
- package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +389 -0
- package/dist/types/data-structures/binary-tree/tree-multi-set.d.ts +330 -0
- package/dist/types/data-structures/binary-tree/tree-set.d.ts +438 -0
- package/dist/types/data-structures/graph/directed-graph.d.ts +30 -0
- package/dist/types/data-structures/graph/undirected-graph.d.ts +27 -0
- package/dist/types/data-structures/hash/hash-map.d.ts +33 -0
- package/dist/types/data-structures/heap/heap.d.ts +42 -0
- package/dist/types/data-structures/linked-list/doubly-linked-list.d.ts +75 -2
- package/dist/types/data-structures/linked-list/singly-linked-list.d.ts +45 -0
- package/dist/types/data-structures/linked-list/skip-linked-list.d.ts +54 -0
- package/dist/types/data-structures/matrix/matrix.d.ts +24 -0
- package/dist/types/data-structures/queue/deque.d.ts +90 -1
- package/dist/types/data-structures/queue/queue.d.ts +36 -0
- package/dist/types/data-structures/stack/stack.d.ts +30 -0
- package/dist/types/data-structures/trie/trie.d.ts +36 -0
- package/dist/umd/data-structure-typed.js +2383 -3
- package/dist/umd/data-structure-typed.min.js +3 -3
- package/docs-site-docusaurus/docs/api/classes/AVLTree.md +108 -108
- package/docs-site-docusaurus/docs/api/classes/BST.md +101 -101
- package/docs-site-docusaurus/docs/api/classes/BinaryIndexedTree.md +13 -13
- package/docs-site-docusaurus/docs/api/classes/BinaryTree.md +66 -66
- package/docs-site-docusaurus/docs/api/classes/Deque.md +235 -51
- package/docs-site-docusaurus/docs/api/classes/DirectedGraph.md +21 -21
- package/docs-site-docusaurus/docs/api/classes/DoublyLinkedList.md +231 -67
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeap.md +9 -9
- package/docs-site-docusaurus/docs/api/classes/FibonacciHeapNode.md +1 -1
- package/docs-site-docusaurus/docs/api/classes/HashMap.md +14 -14
- package/docs-site-docusaurus/docs/api/classes/Heap.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/IterableElementBase.md +83 -13
- package/docs-site-docusaurus/docs/api/classes/LinearBase.md +124 -20
- package/docs-site-docusaurus/docs/api/classes/LinearLinkedBase.md +140 -32
- package/docs-site-docusaurus/docs/api/classes/LinkedHashMap.md +30 -26
- package/docs-site-docusaurus/docs/api/classes/LinkedListQueue.md +159 -51
- package/docs-site-docusaurus/docs/api/classes/MapGraph.md +20 -20
- package/docs-site-docusaurus/docs/api/classes/Matrix.md +23 -23
- package/docs-site-docusaurus/docs/api/classes/MaxHeap.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/MaxPriorityQueue.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/MinHeap.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/MinPriorityQueue.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/PriorityQueue.md +117 -34
- package/docs-site-docusaurus/docs/api/classes/Queue.md +142 -34
- package/docs-site-docusaurus/docs/api/classes/RedBlackTree.md +117 -117
- package/docs-site-docusaurus/docs/api/classes/SegmentTree.md +8 -8
- package/docs-site-docusaurus/docs/api/classes/SinglyLinkedList.md +158 -50
- package/docs-site-docusaurus/docs/api/classes/SkipList.md +21 -21
- package/docs-site-docusaurus/docs/api/classes/Stack.md +108 -26
- package/docs-site-docusaurus/docs/api/classes/TreeMap.md +33 -33
- package/docs-site-docusaurus/docs/api/classes/TreeMultiMap.md +75 -39
- package/docs-site-docusaurus/docs/api/classes/TreeSet.md +301 -39
- package/docs-site-docusaurus/docs/api/classes/Trie.md +110 -28
- package/docs-site-docusaurus/docs/api/classes/UndirectedGraph.md +20 -20
- package/jest.integration.config.js +1 -2
- package/package.json +51 -50
- package/src/common/error.ts +15 -32
- package/src/common/index.ts +0 -3
- package/src/data-structures/base/iterable-element-base.ts +32 -3
- package/src/data-structures/base/linear-base.ts +13 -36
- package/src/data-structures/binary-tree/avl-tree.ts +31 -493
- package/src/data-structures/binary-tree/binary-indexed-tree.ts +47 -530
- package/src/data-structures/binary-tree/binary-tree.ts +326 -1236
- package/src/data-structures/binary-tree/bst.ts +158 -1010
- package/src/data-structures/binary-tree/red-black-tree.ts +451 -1233
- package/src/data-structures/binary-tree/segment-tree.ts +73 -333
- package/src/data-structures/binary-tree/tree-map.ts +462 -4749
- package/src/data-structures/binary-tree/tree-multi-map.ts +310 -4530
- package/src/data-structures/binary-tree/tree-multi-set.ts +300 -3652
- package/src/data-structures/binary-tree/tree-set.ts +437 -4443
- package/src/data-structures/graph/abstract-graph.ts +98 -167
- package/src/data-structures/graph/directed-graph.ts +137 -532
- package/src/data-structures/graph/map-graph.ts +0 -3
- package/src/data-structures/graph/undirected-graph.ts +132 -484
- package/src/data-structures/hash/hash-map.ts +154 -549
- package/src/data-structures/heap/heap.ts +200 -753
- package/src/data-structures/linked-list/doubly-linked-list.ts +153 -809
- package/src/data-structures/linked-list/singly-linked-list.ts +122 -749
- package/src/data-structures/linked-list/skip-linked-list.ts +211 -864
- package/src/data-structures/matrix/matrix.ts +179 -494
- package/src/data-structures/matrix/navigator.ts +0 -1
- package/src/data-structures/priority-queue/max-priority-queue.ts +1 -6
- package/src/data-structures/priority-queue/min-priority-queue.ts +6 -11
- package/src/data-structures/priority-queue/priority-queue.ts +1 -2
- package/src/data-structures/queue/deque.ts +241 -807
- package/src/data-structures/queue/queue.ts +102 -589
- package/src/data-structures/stack/stack.ts +76 -475
- package/src/data-structures/trie/trie.ts +98 -592
- package/src/types/common.ts +0 -10
- package/src/types/data-structures/binary-tree/bst.ts +0 -7
- package/src/types/data-structures/binary-tree/red-black-tree.ts +0 -1
- package/src/types/data-structures/graph/abstract-graph.ts +0 -2
- package/src/types/data-structures/hash/hash-map.ts +0 -3
- package/src/types/data-structures/hash/index.ts +0 -1
- package/src/types/data-structures/matrix/navigator.ts +0 -2
- package/src/types/utils/utils.ts +0 -7
- package/src/types/utils/validate-type.ts +0 -7
- package/src/utils/number.ts +0 -2
- package/src/utils/utils.ts +0 -5
|
@@ -426,7 +426,7 @@ IBinaryTree.[iterator]
|
|
|
426
426
|
add(keyNodeOrEntry): boolean;
|
|
427
427
|
```
|
|
428
428
|
|
|
429
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
429
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:615](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L615)
|
|
430
430
|
|
|
431
431
|
Adds a new node to the tree.
|
|
432
432
|
|
|
@@ -480,7 +480,7 @@ IBinaryTree.add
|
|
|
480
480
|
addMany(keysNodesEntriesOrRaws): boolean[];
|
|
481
481
|
```
|
|
482
482
|
|
|
483
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
483
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:802](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L802)
|
|
484
484
|
|
|
485
485
|
Adds multiple items to the tree.
|
|
486
486
|
|
|
@@ -561,7 +561,7 @@ If true, includes null nodes in the traversal.
|
|
|
561
561
|
bfs(): (K | undefined)[];
|
|
562
562
|
```
|
|
563
563
|
|
|
564
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
564
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2303](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2303)
|
|
565
565
|
|
|
566
566
|
BinaryTree level-order traversal
|
|
567
567
|
|
|
@@ -618,7 +618,7 @@ bfs<C>(
|
|
|
618
618
|
includeNull?): ReturnType<C>[];
|
|
619
619
|
```
|
|
620
620
|
|
|
621
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
621
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2305](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2305)
|
|
622
622
|
|
|
623
623
|
BinaryTree level-order traversal
|
|
624
624
|
|
|
@@ -702,7 +702,7 @@ bfs<C>(
|
|
|
702
702
|
includeNull?): ReturnType<C>[];
|
|
703
703
|
```
|
|
704
704
|
|
|
705
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
705
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2312](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2312)
|
|
706
706
|
|
|
707
707
|
BinaryTree level-order traversal
|
|
708
708
|
|
|
@@ -784,7 +784,7 @@ IBinaryTree.bfs
|
|
|
784
784
|
clear(): void;
|
|
785
785
|
```
|
|
786
786
|
|
|
787
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
787
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:1579](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L1579)
|
|
788
788
|
|
|
789
789
|
Clears the tree of all nodes and values.
|
|
790
790
|
|
|
@@ -825,7 +825,7 @@ IBinaryTree.clear
|
|
|
825
825
|
clone(): this;
|
|
826
826
|
```
|
|
827
827
|
|
|
828
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
828
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2837](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2837)
|
|
829
829
|
|
|
830
830
|
Clones the tree.
|
|
831
831
|
|
|
@@ -947,7 +947,7 @@ IBinaryTree.createTree
|
|
|
947
947
|
delete(keyNodeEntryRawOrPredicate): boolean;
|
|
948
948
|
```
|
|
949
949
|
|
|
950
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
950
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:1057](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L1057)
|
|
951
951
|
|
|
952
952
|
Deletes a node from the tree.
|
|
953
953
|
|
|
@@ -1032,7 +1032,7 @@ If true, includes null nodes in the traversal.
|
|
|
1032
1032
|
dfs(): (K | undefined)[];
|
|
1033
1033
|
```
|
|
1034
1034
|
|
|
1035
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
1035
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2186](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2186)
|
|
1036
1036
|
|
|
1037
1037
|
Depth-first search traversal
|
|
1038
1038
|
|
|
@@ -1068,7 +1068,7 @@ dfs<C>(
|
|
|
1068
1068
|
iterationType?): ReturnType<C>[];
|
|
1069
1069
|
```
|
|
1070
1070
|
|
|
1071
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
1071
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2188](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2188)
|
|
1072
1072
|
|
|
1073
1073
|
Depth-first search traversal
|
|
1074
1074
|
|
|
@@ -1136,7 +1136,7 @@ dfs<C>(
|
|
|
1136
1136
|
includeNull?): ReturnType<C>[];
|
|
1137
1137
|
```
|
|
1138
1138
|
|
|
1139
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
1139
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2196](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2196)
|
|
1140
1140
|
|
|
1141
1141
|
Depth-first search traversal
|
|
1142
1142
|
|
|
@@ -1322,7 +1322,7 @@ IBinaryTree.every
|
|
|
1322
1322
|
filter(predicate, thisArg?): this;
|
|
1323
1323
|
```
|
|
1324
1324
|
|
|
1325
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
1325
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2896](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2896)
|
|
1326
1326
|
|
|
1327
1327
|
Creates a new tree containing only the entries that satisfy the predicate.
|
|
1328
1328
|
|
|
@@ -1472,7 +1472,7 @@ get(
|
|
|
1472
1472
|
iterationType?): V | undefined;
|
|
1473
1473
|
```
|
|
1474
1474
|
|
|
1475
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
1475
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:1405](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L1405)
|
|
1476
1476
|
|
|
1477
1477
|
Gets the value associated with a key.
|
|
1478
1478
|
|
|
@@ -1542,7 +1542,7 @@ IBinaryTree.get
|
|
|
1542
1542
|
getDepth(dist, startNode?): number;
|
|
1543
1543
|
```
|
|
1544
1544
|
|
|
1545
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
1545
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:1801](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L1801)
|
|
1546
1546
|
|
|
1547
1547
|
Gets the depth of a node (distance from `startNode`).
|
|
1548
1548
|
|
|
@@ -1602,7 +1602,7 @@ IBinaryTree.getDepth
|
|
|
1602
1602
|
getHeight(startNode?, iterationType?): number;
|
|
1603
1603
|
```
|
|
1604
1604
|
|
|
1605
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
1605
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:1872](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L1872)
|
|
1606
1606
|
|
|
1607
1607
|
Gets the maximum height of the tree (longest path from startNode to a leaf).
|
|
1608
1608
|
|
|
@@ -1681,7 +1681,7 @@ The traversal method.
|
|
|
1681
1681
|
getLeftMost(): K | undefined;
|
|
1682
1682
|
```
|
|
1683
1683
|
|
|
1684
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
1684
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:1999](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L1999)
|
|
1685
1685
|
|
|
1686
1686
|
##### Returns
|
|
1687
1687
|
|
|
@@ -1702,7 +1702,7 @@ getLeftMost<C>(
|
|
|
1702
1702
|
iterationType?): ReturnType<C>;
|
|
1703
1703
|
```
|
|
1704
1704
|
|
|
1705
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
1705
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2001](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2001)
|
|
1706
1706
|
|
|
1707
1707
|
##### Type Parameters
|
|
1708
1708
|
|
|
@@ -1745,7 +1745,7 @@ IBinaryTree.getLeftMost
|
|
|
1745
1745
|
getMinHeight(startNode?, iterationType?): number;
|
|
1746
1746
|
```
|
|
1747
1747
|
|
|
1748
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
1748
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:1914](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L1914)
|
|
1749
1749
|
|
|
1750
1750
|
Gets the minimum height of the tree (shortest path from startNode to a leaf).
|
|
1751
1751
|
|
|
@@ -1793,7 +1793,7 @@ getNode(
|
|
|
1793
1793
|
iterationType?): BinaryTreeNode<K, V> | null | undefined;
|
|
1794
1794
|
```
|
|
1795
1795
|
|
|
1796
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
1796
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:1328](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L1328)
|
|
1797
1797
|
|
|
1798
1798
|
Gets the first node matching a predicate.
|
|
1799
1799
|
|
|
@@ -1863,7 +1863,7 @@ getNodes(
|
|
|
1863
1863
|
iterationType?): BinaryTreeNode<K, V>[];
|
|
1864
1864
|
```
|
|
1865
1865
|
|
|
1866
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
1866
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:1247](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L1247)
|
|
1867
1867
|
|
|
1868
1868
|
Gets all nodes matching a predicate.
|
|
1869
1869
|
|
|
@@ -1954,7 +1954,7 @@ If true, returns the path from root-to-node.
|
|
|
1954
1954
|
getPathToRoot(beginNode): (K | undefined)[];
|
|
1955
1955
|
```
|
|
1956
1956
|
|
|
1957
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
1957
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:1961](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L1961)
|
|
1958
1958
|
|
|
1959
1959
|
##### Parameters
|
|
1960
1960
|
|
|
@@ -1985,7 +1985,7 @@ getPathToRoot<C>(
|
|
|
1985
1985
|
isReverse?): ReturnType<C>[];
|
|
1986
1986
|
```
|
|
1987
1987
|
|
|
1988
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
1988
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:1965](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L1965)
|
|
1989
1989
|
|
|
1990
1990
|
##### Type Parameters
|
|
1991
1991
|
|
|
@@ -2029,7 +2029,7 @@ IBinaryTree.getPathToRoot
|
|
|
2029
2029
|
getPredecessor(node): BinaryTreeNode<K, V>;
|
|
2030
2030
|
```
|
|
2031
2031
|
|
|
2032
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
2032
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2099](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2099)
|
|
2033
2033
|
|
|
2034
2034
|
Gets the Morris traversal predecessor (rightmost node in the left subtree, or node itself).
|
|
2035
2035
|
|
|
@@ -2083,7 +2083,7 @@ The traversal method.
|
|
|
2083
2083
|
getRightMost(): K | undefined;
|
|
2084
2084
|
```
|
|
2085
2085
|
|
|
2086
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
2086
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2046](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2046)
|
|
2087
2087
|
|
|
2088
2088
|
##### Returns
|
|
2089
2089
|
|
|
@@ -2104,7 +2104,7 @@ getRightMost<C>(
|
|
|
2104
2104
|
iterationType?): ReturnType<C>;
|
|
2105
2105
|
```
|
|
2106
2106
|
|
|
2107
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
2107
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2048](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2048)
|
|
2108
2108
|
|
|
2109
2109
|
##### Type Parameters
|
|
2110
2110
|
|
|
@@ -2147,7 +2147,7 @@ IBinaryTree.getRightMost
|
|
|
2147
2147
|
getSuccessor(x?): BinaryTreeNode<K, V> | null | undefined;
|
|
2148
2148
|
```
|
|
2149
2149
|
|
|
2150
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
2150
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2120](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2120)
|
|
2151
2151
|
|
|
2152
2152
|
Gets the in-order successor of a node in a BST.
|
|
2153
2153
|
|
|
@@ -2180,7 +2180,7 @@ has(
|
|
|
2180
2180
|
iterationType?): boolean;
|
|
2181
2181
|
```
|
|
2182
2182
|
|
|
2183
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
2183
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:1497](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L1497)
|
|
2184
2184
|
|
|
2185
2185
|
Checks if a node matching the predicate exists in the tree.
|
|
2186
2186
|
|
|
@@ -2313,7 +2313,7 @@ IBinaryTree.hasValue
|
|
|
2313
2313
|
isBST(startNode?, iterationType?): boolean;
|
|
2314
2314
|
```
|
|
2315
2315
|
|
|
2316
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
2316
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:1703](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L1703)
|
|
2317
2317
|
|
|
2318
2318
|
Checks if the tree is a valid Binary Search Tree (BST).
|
|
2319
2319
|
|
|
@@ -2369,7 +2369,7 @@ IBinaryTree.isBST
|
|
|
2369
2369
|
isEmpty(): boolean;
|
|
2370
2370
|
```
|
|
2371
2371
|
|
|
2372
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
2372
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:1633](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L1633)
|
|
2373
2373
|
|
|
2374
2374
|
Checks if the tree is empty.
|
|
2375
2375
|
|
|
@@ -2546,7 +2546,7 @@ Time O(1), Space O(1)
|
|
|
2546
2546
|
isPerfectlyBalanced(startNode?): boolean;
|
|
2547
2547
|
```
|
|
2548
2548
|
|
|
2549
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
2549
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:1644](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L1644)
|
|
2550
2550
|
|
|
2551
2551
|
Checks if the tree is perfectly balanced.
|
|
2552
2552
|
|
|
@@ -2810,7 +2810,7 @@ The traversal method.
|
|
|
2810
2810
|
leaves(): (K | undefined)[];
|
|
2811
2811
|
```
|
|
2812
2812
|
|
|
2813
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
2813
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2435](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2435)
|
|
2814
2814
|
|
|
2815
2815
|
Get leaf nodes
|
|
2816
2816
|
|
|
@@ -2844,7 +2844,7 @@ leaves<C>(
|
|
|
2844
2844
|
iterationType?): ReturnType<C>[];
|
|
2845
2845
|
```
|
|
2846
2846
|
|
|
2847
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
2847
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2437](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2437)
|
|
2848
2848
|
|
|
2849
2849
|
Get leaf nodes
|
|
2850
2850
|
|
|
@@ -2928,7 +2928,7 @@ If true, includes null nodes.
|
|
|
2928
2928
|
listLevels(): (K | undefined)[][];
|
|
2929
2929
|
```
|
|
2930
2930
|
|
|
2931
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
2931
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2543](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2543)
|
|
2932
2932
|
|
|
2933
2933
|
Level-order grouping
|
|
2934
2934
|
|
|
@@ -2964,7 +2964,7 @@ listLevels<C>(
|
|
|
2964
2964
|
includeNull?): ReturnType<C>[][];
|
|
2965
2965
|
```
|
|
2966
2966
|
|
|
2967
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
2967
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2545](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2545)
|
|
2968
2968
|
|
|
2969
2969
|
Level-order grouping
|
|
2970
2970
|
|
|
@@ -3027,7 +3027,7 @@ listLevels<C>(
|
|
|
3027
3027
|
includeNull?): ReturnType<C>[][];
|
|
3028
3028
|
```
|
|
3029
3029
|
|
|
3030
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
3030
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2552](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2552)
|
|
3031
3031
|
|
|
3032
3032
|
Level-order grouping
|
|
3033
3033
|
|
|
@@ -3091,7 +3091,7 @@ map<MK, MV, MR>(
|
|
|
3091
3091
|
thisArg?): BinaryTree<MK, MV, MR>;
|
|
3092
3092
|
```
|
|
3093
3093
|
|
|
3094
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
3094
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2960](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2960)
|
|
3095
3095
|
|
|
3096
3096
|
Creates a new tree by mapping each [key, value] pair to a new entry.
|
|
3097
3097
|
|
|
@@ -3174,7 +3174,7 @@ IBinaryTree.map
|
|
|
3174
3174
|
merge(anotherTree): void;
|
|
3175
3175
|
```
|
|
3176
3176
|
|
|
3177
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
3177
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:937](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L937)
|
|
3178
3178
|
|
|
3179
3179
|
Merges another tree into this one by seting all its nodes.
|
|
3180
3180
|
|
|
@@ -3244,7 +3244,7 @@ The node to start from.
|
|
|
3244
3244
|
morris(): (K | undefined)[];
|
|
3245
3245
|
```
|
|
3246
3246
|
|
|
3247
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
3247
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2667](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2667)
|
|
3248
3248
|
|
|
3249
3249
|
Morris traversal (O(1) space)
|
|
3250
3250
|
|
|
@@ -3278,7 +3278,7 @@ morris<C>(
|
|
|
3278
3278
|
startNode?): ReturnType<C>[];
|
|
3279
3279
|
```
|
|
3280
3280
|
|
|
3281
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
3281
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2669](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2669)
|
|
3282
3282
|
|
|
3283
3283
|
Morris traversal (O(1) space)
|
|
3284
3284
|
|
|
@@ -3334,7 +3334,7 @@ IBinaryTree.morris
|
|
|
3334
3334
|
print(options?, startNode?): void;
|
|
3335
3335
|
```
|
|
3336
3336
|
|
|
3337
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
3337
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3056](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3056)
|
|
3338
3338
|
|
|
3339
3339
|
Prints a visual representation of the tree to the console.
|
|
3340
3340
|
|
|
@@ -3469,7 +3469,7 @@ Whether to use 'RECURSIVE' or 'ITERATIVE' search.
|
|
|
3469
3469
|
search(keyNodeEntryOrPredicate, onlyOne?): (K | undefined)[];
|
|
3470
3470
|
```
|
|
3471
3471
|
|
|
3472
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
3472
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:1104](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L1104)
|
|
3473
3473
|
|
|
3474
3474
|
Search by predicate
|
|
3475
3475
|
|
|
@@ -3520,7 +3520,7 @@ search<C>(
|
|
|
3520
3520
|
iterationType?): ReturnType<C>[];
|
|
3521
3521
|
```
|
|
3522
3522
|
|
|
3523
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
3523
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:1115](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L1115)
|
|
3524
3524
|
|
|
3525
3525
|
Search by predicate
|
|
3526
3526
|
|
|
@@ -3589,7 +3589,7 @@ IBinaryTree.search
|
|
|
3589
3589
|
set(keyNodeOrEntry, value?): boolean;
|
|
3590
3590
|
```
|
|
3591
3591
|
|
|
3592
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
3592
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:694](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L694)
|
|
3593
3593
|
|
|
3594
3594
|
Adds or updates a new node to the tree.
|
|
3595
3595
|
|
|
@@ -3664,7 +3664,7 @@ IBinaryTree.set
|
|
|
3664
3664
|
setMany(keysNodesEntriesOrRaws, values?): boolean[];
|
|
3665
3665
|
```
|
|
3666
3666
|
|
|
3667
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
3667
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:856](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L856)
|
|
3668
3668
|
|
|
3669
3669
|
Adds or updates multiple items to the tree.
|
|
3670
3670
|
|
|
@@ -3789,7 +3789,7 @@ Time O(n), Space O(n)
|
|
|
3789
3789
|
toVisual(startNode?, options?): string;
|
|
3790
3790
|
```
|
|
3791
3791
|
|
|
3792
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
3792
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:2979](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L2979)
|
|
3793
3793
|
|
|
3794
3794
|
Generates a string representation of the tree for visualization.
|
|
3795
3795
|
|
|
@@ -3867,7 +3867,7 @@ IBinaryTree.values
|
|
|
3867
3867
|
protected readonly _DEFAULT_NODE_CALLBACK: NodeCallback<BinaryTreeNode<K, V> | null | undefined, K | undefined>;
|
|
3868
3868
|
```
|
|
3869
3869
|
|
|
3870
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
3870
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3252](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3252)
|
|
3871
3871
|
|
|
3872
3872
|
(Protected) Default callback function, returns the node's key.
|
|
3873
3873
|
|
|
@@ -3891,7 +3891,7 @@ The node's key or undefined.
|
|
|
3891
3891
|
protected _clearNodes(): void;
|
|
3892
3892
|
```
|
|
3893
3893
|
|
|
3894
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
3894
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3686](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3686)
|
|
3895
3895
|
|
|
3896
3896
|
(Protected) Clears all nodes from the tree.
|
|
3897
3897
|
|
|
@@ -3911,7 +3911,7 @@ Time O(1)
|
|
|
3911
3911
|
protected _clearValues(): void;
|
|
3912
3912
|
```
|
|
3913
3913
|
|
|
3914
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
3914
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3695](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3695)
|
|
3915
3915
|
|
|
3916
3916
|
(Protected) Clears all values from the external store.
|
|
3917
3917
|
|
|
@@ -3931,7 +3931,7 @@ Time O(N)
|
|
|
3931
3931
|
protected _clone(cloned): void;
|
|
3932
3932
|
```
|
|
3933
3933
|
|
|
3934
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
3934
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3345](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3345)
|
|
3935
3935
|
|
|
3936
3936
|
(Protected) Helper for cloning. Performs a BFS and sets all nodes to the new tree.
|
|
3937
3937
|
|
|
@@ -3959,7 +3959,7 @@ Time O(N * M) (O(N) BFS + O(M) `set` for each node).
|
|
|
3959
3959
|
protected _createInstance<TK, TV, TR>(options?): this;
|
|
3960
3960
|
```
|
|
3961
3961
|
|
|
3962
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
3962
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3279](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3279)
|
|
3963
3963
|
|
|
3964
3964
|
(Protected) Creates a new, empty instance of the same tree constructor.
|
|
3965
3965
|
|
|
@@ -4003,7 +4003,7 @@ Time O(1)
|
|
|
4003
4003
|
protected _createLike<TK, TV, TR>(iter?, options?): BinaryTree<TK, TV, TR>;
|
|
4004
4004
|
```
|
|
4005
4005
|
|
|
4006
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
4006
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3296](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3296)
|
|
4007
4007
|
|
|
4008
4008
|
(Protected) Creates a new instance of the same tree constructor, potentially with different generic types.
|
|
4009
4009
|
|
|
@@ -4059,7 +4059,7 @@ Time O(N) (or as per constructor) due to processing the iterable.
|
|
|
4059
4059
|
protected _deleteInternal(keyNodeEntryRawOrPredicate): BinaryTreeDeleteResult<BinaryTreeNode<K, V>>[];
|
|
4060
4060
|
```
|
|
4061
4061
|
|
|
4062
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
4062
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:949](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L949)
|
|
4063
4063
|
|
|
4064
4064
|
**`Internal`**
|
|
4065
4065
|
|
|
@@ -4103,7 +4103,7 @@ protected _dfs<C>(
|
|
|
4103
4103
|
shouldProcessRoot?): ReturnType<C>[];
|
|
4104
4104
|
```
|
|
4105
4105
|
|
|
4106
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
4106
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3063](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3063)
|
|
4107
4107
|
|
|
4108
4108
|
#### Type Parameters
|
|
4109
4109
|
|
|
@@ -4192,7 +4192,7 @@ Array of callback results.
|
|
|
4192
4192
|
protected _displayAux(node, options): NodeDisplayLayout;
|
|
4193
4193
|
```
|
|
4194
4194
|
|
|
4195
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
4195
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3369](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3369)
|
|
4196
4196
|
|
|
4197
4197
|
(Protected) Recursive helper for `toVisual`.
|
|
4198
4198
|
|
|
@@ -4228,7 +4228,7 @@ Time O(N), Space O(N*H) or O(N^2)
|
|
|
4228
4228
|
protected _ensurePredicate(keyNodeEntryOrPredicate): NodePredicate<BinaryTreeNode<K, V>>;
|
|
4229
4229
|
```
|
|
4230
4230
|
|
|
4231
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
4231
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3592](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3592)
|
|
4232
4232
|
|
|
4233
4233
|
(Protected) Converts a key, node, entry, or predicate into a standardized predicate function.
|
|
4234
4234
|
|
|
@@ -4263,7 +4263,7 @@ Time O(1)
|
|
|
4263
4263
|
protected _extractKey(keyNodeOrEntry): K | null | undefined;
|
|
4264
4264
|
```
|
|
4265
4265
|
|
|
4266
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
4266
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3652](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3652)
|
|
4267
4267
|
|
|
4268
4268
|
(Protected) Extracts the key from a key, node, or entry.
|
|
4269
4269
|
|
|
@@ -4297,7 +4297,7 @@ Time O(1)
|
|
|
4297
4297
|
protected _getIterator(node?): IterableIterator<[K, V | undefined]>;
|
|
4298
4298
|
```
|
|
4299
4299
|
|
|
4300
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
4300
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3208](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3208)
|
|
4301
4301
|
|
|
4302
4302
|
(Protected) Gets the iterator for the tree (default in-order).
|
|
4303
4303
|
|
|
@@ -4331,7 +4331,7 @@ Time O(N) for full iteration. O(H) to get the first element. Space O(H) for the
|
|
|
4331
4331
|
protected _isDisplayLeaf(node, options): boolean;
|
|
4332
4332
|
```
|
|
4333
4333
|
|
|
4334
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
4334
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3464](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3464)
|
|
4335
4335
|
|
|
4336
4336
|
Check if a node is a display leaf (empty, null, undefined, NIL, or real leaf).
|
|
4337
4337
|
|
|
@@ -4357,7 +4357,7 @@ Check if a node is a display leaf (empty, null, undefined, NIL, or real leaf).
|
|
|
4357
4357
|
protected _isPredicate(p): p is NodePredicate<BinaryTreeNode<K, V>>;
|
|
4358
4358
|
```
|
|
4359
4359
|
|
|
4360
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
4360
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3641](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3641)
|
|
4361
4361
|
|
|
4362
4362
|
(Protected) Checks if an item is a predicate function.
|
|
4363
4363
|
|
|
@@ -4387,7 +4387,7 @@ Time O(1)
|
|
|
4387
4387
|
protected _keyValueNodeOrEntryToNodeAndValue(keyNodeOrEntry, value?): [BinaryTreeNode<K, V> | null | undefined, V | undefined];
|
|
4388
4388
|
```
|
|
4389
4389
|
|
|
4390
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
4390
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3319](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3319)
|
|
4391
4391
|
|
|
4392
4392
|
(Protected) Converts a key, node, or entry into a standardized [node, value] tuple.
|
|
4393
4393
|
|
|
@@ -4427,7 +4427,7 @@ Time O(1)
|
|
|
4427
4427
|
protected _replaceNode(oldNode, newNode): BinaryTreeNode<K, V>;
|
|
4428
4428
|
```
|
|
4429
4429
|
|
|
4430
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
4430
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3554](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3554)
|
|
4431
4431
|
|
|
4432
4432
|
(Protected) Replaces a node in the tree with a new node, maintaining children and parent links.
|
|
4433
4433
|
|
|
@@ -4466,7 +4466,7 @@ protected _resolveDisplayLeaf(
|
|
|
4466
4466
|
emptyDisplayLayout): NodeDisplayLayout;
|
|
4467
4467
|
```
|
|
4468
4468
|
|
|
4469
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
4469
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3494](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3494)
|
|
4470
4470
|
|
|
4471
4471
|
Resolve a display leaf node to its layout.
|
|
4472
4472
|
|
|
@@ -4496,7 +4496,7 @@ Resolve a display leaf node to its layout.
|
|
|
4496
4496
|
protected _setRoot(v): void;
|
|
4497
4497
|
```
|
|
4498
4498
|
|
|
4499
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
4499
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3578](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3578)
|
|
4500
4500
|
|
|
4501
4501
|
(Protected) Sets the root node and clears its parent reference.
|
|
4502
4502
|
|
|
@@ -4524,7 +4524,7 @@ Time O(1)
|
|
|
4524
4524
|
protected _setValue(key, value): boolean;
|
|
4525
4525
|
```
|
|
4526
4526
|
|
|
4527
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
4527
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3673](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3673)
|
|
4528
4528
|
|
|
4529
4529
|
(Protected) Sets a value in the external store (Map mode).
|
|
4530
4530
|
|
|
@@ -4560,7 +4560,7 @@ Time O(1) (average for Map.set).
|
|
|
4560
4560
|
protected _snapshotOptions<TK, TV, TR>(): BinaryTreeOptions<TK, TV, TR>;
|
|
4561
4561
|
```
|
|
4562
4562
|
|
|
4563
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
4563
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3262](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3262)
|
|
4564
4564
|
|
|
4565
4565
|
(Protected) Snapshots the current tree's configuration options.
|
|
4566
4566
|
|
|
@@ -4596,7 +4596,7 @@ Time O(1)
|
|
|
4596
4596
|
protected _swapProperties(srcNode, destNode): BinaryTreeNode<K, V> | undefined;
|
|
4597
4597
|
```
|
|
4598
4598
|
|
|
4599
|
-
Defined in: [data-structures/binary-tree/binary-tree.ts:
|
|
4599
|
+
Defined in: [data-structures/binary-tree/binary-tree.ts:3520](https://github.com/zrwusa/data-structure-typed/blob/main/src/data-structures/binary-tree/binary-tree.ts#L3520)
|
|
4600
4600
|
|
|
4601
4601
|
(Protected) Swaps the key/value properties of two nodes.
|
|
4602
4602
|
|