data-structure-typed 1.31.0 → 1.32.0
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/.gitattributes +112 -0
- package/CHANGELOG.md +1 -1
- package/CODE-OF-CONDUCT.md +80 -0
- package/COMMANDS.md +28 -0
- package/SECURITY.md +15 -0
- package/coverage/clover.xml +3393 -0
- package/coverage/coverage-final.json +67 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +386 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov-report/src/data-structures/binary-tree/aa-tree.ts.html +88 -0
- package/coverage/lcov-report/src/data-structures/binary-tree/abstract-binary-tree.ts.html +4966 -0
- package/coverage/lcov-report/src/data-structures/binary-tree/avl-tree.ts.html +1015 -0
- package/coverage/lcov-report/src/data-structures/binary-tree/b-tree.ts.html +88 -0
- package/coverage/lcov-report/src/data-structures/binary-tree/binary-indexed-tree.ts.html +313 -0
- package/coverage/lcov-report/src/data-structures/binary-tree/binary-tree.ts.html +226 -0
- package/coverage/lcov-report/src/data-structures/binary-tree/bst.ts.html +1714 -0
- package/coverage/lcov-report/src/data-structures/binary-tree/index.html +296 -0
- package/coverage/lcov-report/src/data-structures/binary-tree/index.ts.html +121 -0
- package/coverage/lcov-report/src/data-structures/binary-tree/rb-tree.ts.html +388 -0
- package/coverage/lcov-report/src/data-structures/binary-tree/segment-tree.ts.html +811 -0
- package/coverage/lcov-report/src/data-structures/binary-tree/splay-tree.ts.html +88 -0
- package/coverage/lcov-report/src/data-structures/binary-tree/tree-multiset.ts.html +2185 -0
- package/coverage/lcov-report/src/data-structures/binary-tree/two-three-tree.ts.html +88 -0
- package/coverage/lcov-report/src/data-structures/graph/abstract-graph.ts.html +3205 -0
- package/coverage/lcov-report/src/data-structures/graph/directed-graph.ts.html +1495 -0
- package/coverage/lcov-report/src/data-structures/graph/index.html +176 -0
- package/coverage/lcov-report/src/data-structures/graph/index.ts.html +97 -0
- package/coverage/lcov-report/src/data-structures/graph/map-graph.ts.html +472 -0
- package/coverage/lcov-report/src/data-structures/graph/undirected-graph.ts.html +907 -0
- package/coverage/lcov-report/src/data-structures/hash/coordinate-map.ts.html +286 -0
- package/coverage/lcov-report/src/data-structures/hash/coordinate-set.ts.html +253 -0
- package/coverage/lcov-report/src/data-structures/hash/hash-table.ts.html +88 -0
- package/coverage/lcov-report/src/data-structures/hash/index.html +206 -0
- package/coverage/lcov-report/src/data-structures/hash/index.ts.html +103 -0
- package/coverage/lcov-report/src/data-structures/hash/pair.ts.html +88 -0
- package/coverage/lcov-report/src/data-structures/hash/tree-map.ts.html +88 -0
- package/coverage/lcov-report/src/data-structures/hash/tree-set.ts.html +88 -0
- package/coverage/lcov-report/src/data-structures/heap/heap.ts.html +721 -0
- package/coverage/lcov-report/src/data-structures/heap/index.html +161 -0
- package/coverage/lcov-report/src/data-structures/heap/index.ts.html +94 -0
- package/coverage/lcov-report/src/data-structures/heap/max-heap.ts.html +178 -0
- package/coverage/lcov-report/src/data-structures/heap/min-heap.ts.html +181 -0
- package/coverage/lcov-report/src/data-structures/index.html +116 -0
- package/coverage/lcov-report/src/data-structures/index.ts.html +118 -0
- package/coverage/lcov-report/src/data-structures/linked-list/doubly-linked-list.ts.html +1804 -0
- package/coverage/lcov-report/src/data-structures/linked-list/index.html +161 -0
- package/coverage/lcov-report/src/data-structures/linked-list/index.ts.html +94 -0
- package/coverage/lcov-report/src/data-structures/linked-list/singly-linked-list.ts.html +1588 -0
- package/coverage/lcov-report/src/data-structures/linked-list/skip-linked-list.ts.html +88 -0
- package/coverage/lcov-report/src/data-structures/matrix/index.html +176 -0
- package/coverage/lcov-report/src/data-structures/matrix/index.ts.html +97 -0
- package/coverage/lcov-report/src/data-structures/matrix/matrix.ts.html +166 -0
- package/coverage/lcov-report/src/data-structures/matrix/matrix2d.ts.html +721 -0
- package/coverage/lcov-report/src/data-structures/matrix/navigator.ts.html +448 -0
- package/coverage/lcov-report/src/data-structures/matrix/vector2d.ts.html +1033 -0
- package/coverage/lcov-report/src/data-structures/priority-queue/index.html +161 -0
- package/coverage/lcov-report/src/data-structures/priority-queue/index.ts.html +94 -0
- package/coverage/lcov-report/src/data-structures/priority-queue/max-priority-queue.ts.html +253 -0
- package/coverage/lcov-report/src/data-structures/priority-queue/min-priority-queue.ts.html +256 -0
- package/coverage/lcov-report/src/data-structures/priority-queue/priority-queue.ts.html +1162 -0
- package/coverage/lcov-report/src/data-structures/queue/deque.ts.html +976 -0
- package/coverage/lcov-report/src/data-structures/queue/index.html +146 -0
- package/coverage/lcov-report/src/data-structures/queue/index.ts.html +91 -0
- package/coverage/lcov-report/src/data-structures/queue/queue.ts.html +658 -0
- package/coverage/lcov-report/src/data-structures/stack/index.html +131 -0
- package/coverage/lcov-report/src/data-structures/stack/index.ts.html +88 -0
- package/coverage/lcov-report/src/data-structures/stack/stack.ts.html +379 -0
- package/coverage/lcov-report/src/data-structures/tree/index.html +131 -0
- package/coverage/lcov-report/src/data-structures/tree/index.ts.html +88 -0
- package/coverage/lcov-report/src/data-structures/tree/tree.ts.html +292 -0
- package/coverage/lcov-report/src/data-structures/trie/index.html +131 -0
- package/coverage/lcov-report/src/data-structures/trie/index.ts.html +88 -0
- package/coverage/lcov-report/src/data-structures/trie/trie.ts.html +760 -0
- package/coverage/lcov-report/src/index.html +116 -0
- package/coverage/lcov-report/src/index.ts.html +97 -0
- package/coverage/lcov-report/src/interfaces/index.html +116 -0
- package/coverage/lcov-report/src/interfaces/index.ts.html +130 -0
- package/coverage/lcov-report/src/types/data-structures/abstract-binary-tree.ts.html +235 -0
- package/coverage/lcov-report/src/types/data-structures/bst.ts.html +124 -0
- package/coverage/lcov-report/src/types/data-structures/directed-graph.ts.html +109 -0
- package/coverage/lcov-report/src/types/data-structures/index.html +176 -0
- package/coverage/lcov-report/src/types/data-structures/index.ts.html +130 -0
- package/coverage/lcov-report/src/types/data-structures/rb-tree.ts.html +106 -0
- package/coverage/lcov-report/src/types/index.html +116 -0
- package/coverage/lcov-report/src/types/index.ts.html +94 -0
- package/coverage/lcov-report/src/types/utils/index.html +116 -0
- package/coverage/lcov-report/src/types/utils/index.ts.html +91 -0
- package/coverage/lcov-report/src/utils/index.html +131 -0
- package/coverage/lcov-report/src/utils/index.ts.html +88 -0
- package/coverage/lcov-report/src/utils/utils.ts.html +322 -0
- package/coverage/lcov-report/test/utils/index.html +146 -0
- package/coverage/lcov-report/test/utils/index.ts.html +91 -0
- package/coverage/lcov-report/test/utils/magnitude.ts.html +148 -0
- package/coverage/lcov-report/test/utils/number.ts.html +94 -0
- package/coverage/lcov.info +6676 -0
- package/dist/data-structures/binary-tree/abstract-binary-tree.js.map +1 -1
- package/docs/classes/AVLTree.html +205 -282
- package/docs/classes/AVLTreeNode.html +15 -15
- package/docs/classes/AaTree.html +1 -1
- package/docs/classes/AbstractBinaryTree.html +198 -275
- package/docs/classes/AbstractBinaryTreeNode.html +21 -21
- package/docs/classes/AbstractEdge.html +11 -11
- package/docs/classes/AbstractGraph.html +36 -36
- package/docs/classes/AbstractVertex.html +8 -8
- package/docs/classes/ArrayDeque.html +14 -14
- package/docs/classes/BST.html +198 -275
- package/docs/classes/BSTNode.html +15 -15
- package/docs/classes/BTree.html +1 -1
- package/docs/classes/BinaryIndexedTree.html +9 -9
- package/docs/classes/BinaryTree.html +191 -268
- package/docs/classes/BinaryTreeNode.html +15 -15
- package/docs/classes/Character.html +4 -4
- package/docs/classes/CoordinateMap.html +9 -9
- package/docs/classes/CoordinateSet.html +8 -8
- package/docs/classes/Deque.html +34 -34
- package/docs/classes/DirectedEdge.html +15 -15
- package/docs/classes/DirectedGraph.html +52 -52
- package/docs/classes/DirectedVertex.html +6 -6
- package/docs/classes/DoublyLinkedList.html +37 -37
- package/docs/classes/DoublyLinkedListNode.html +11 -11
- package/docs/classes/HashTable.html +1 -1
- package/docs/classes/Heap.html +26 -26
- package/docs/classes/HeapItem.html +8 -8
- package/docs/classes/LinkedListQueue.html +35 -35
- package/docs/classes/MapEdge.html +13 -13
- package/docs/classes/MapGraph.html +56 -56
- package/docs/classes/MapVertex.html +12 -12
- package/docs/classes/Matrix2D.html +16 -16
- package/docs/classes/MatrixNTI2D.html +4 -4
- package/docs/classes/MaxHeap.html +26 -26
- package/docs/classes/MaxPriorityQueue.html +34 -34
- package/docs/classes/MinHeap.html +26 -26
- package/docs/classes/MinPriorityQueue.html +34 -34
- package/docs/classes/Navigator.html +10 -10
- package/docs/classes/ObjectDeque.html +25 -25
- package/docs/classes/Pair.html +1 -1
- package/docs/classes/PriorityQueue.html +32 -32
- package/docs/classes/Queue.html +22 -22
- package/docs/classes/RBTree.html +198 -275
- package/docs/classes/RBTreeNode.html +18 -18
- package/docs/classes/SegmentTree.html +17 -17
- package/docs/classes/SegmentTreeNode.html +20 -20
- package/docs/classes/SinglyLinkedList.html +35 -35
- package/docs/classes/SinglyLinkedListNode.html +8 -8
- package/docs/classes/SkipLinkedList.html +1 -1
- package/docs/classes/SplayTree.html +1 -1
- package/docs/classes/Stack.html +12 -12
- package/docs/classes/TreeMap.html +1 -1
- package/docs/classes/TreeMultiset.html +219 -296
- package/docs/classes/TreeMultisetNode.html +18 -18
- package/docs/classes/TreeNode.html +13 -13
- package/docs/classes/TreeSet.html +1 -1
- package/docs/classes/Trie.html +13 -13
- package/docs/classes/TrieNode.html +11 -11
- package/docs/classes/TwoThreeTree.html +1 -1
- package/docs/classes/UndirectedEdge.html +12 -12
- package/docs/classes/UndirectedGraph.html +40 -40
- package/docs/classes/UndirectedVertex.html +6 -6
- package/docs/classes/Vector2D.html +28 -28
- package/docs/enums/CP.html +4 -4
- package/docs/enums/FamilyPosition.html +8 -8
- package/docs/enums/LoopType.html +3 -3
- package/docs/enums/RBColor.html +3 -3
- package/docs/enums/TopologicalProperty.html +4 -4
- package/docs/functions/arrayRemove.html +1 -1
- package/docs/functions/isThunk.html +1 -1
- package/docs/functions/toThunk.html +1 -1
- package/docs/functions/trampoline.html +1 -1
- package/docs/functions/trampolineAsync.html +1 -1
- package/docs/functions/uuidV4.html +1 -1
- package/docs/interfaces/IAVLTree.html +77 -77
- package/docs/interfaces/IAbstractBinaryTree.html +72 -72
- package/docs/interfaces/IAbstractBinaryTreeNode.html +14 -14
- package/docs/interfaces/IAbstractGraph.html +15 -15
- package/docs/interfaces/IBST.html +77 -77
- package/docs/interfaces/IDirectedGraph.html +23 -23
- package/docs/interfaces/IRBTree.html +77 -77
- package/docs/interfaces/IUNDirectedGraph.html +16 -16
- package/docs/types/AVLTreeNodeNested.html +1 -1
- package/docs/types/AVLTreeOptions.html +1 -1
- package/docs/types/AbstractBinaryTreeNodeNested.html +1 -1
- package/docs/types/AbstractBinaryTreeNodeProperties.html +1 -1
- package/docs/types/AbstractBinaryTreeNodeProperty.html +1 -1
- package/docs/types/AbstractBinaryTreeOptions.html +1 -1
- package/docs/types/BSTComparator.html +1 -1
- package/docs/types/BSTNodeNested.html +1 -1
- package/docs/types/BSTOptions.html +1 -1
- package/docs/types/BinaryTreeDeletedResult.html +1 -1
- package/docs/types/BinaryTreeNodeId.html +1 -1
- package/docs/types/BinaryTreeNodeNested.html +1 -1
- package/docs/types/BinaryTreeNodePropertyName.html +1 -1
- package/docs/types/BinaryTreeOptions.html +1 -1
- package/docs/types/DFSOrderPattern.html +1 -1
- package/docs/types/DijkstraResult.html +1 -1
- package/docs/types/Direction.html +1 -1
- package/docs/types/DummyAny.html +1 -1
- package/docs/types/EdgeId.html +1 -1
- package/docs/types/HeapOptions.html +1 -1
- package/docs/types/IAVLTreeNode.html +1 -1
- package/docs/types/IBSTNode.html +1 -1
- package/docs/types/IBinaryTree.html +1 -1
- package/docs/types/IBinaryTreeNode.html +1 -1
- package/docs/types/IRBTreeNode.html +1 -1
- package/docs/types/ITreeMultiset.html +1 -1
- package/docs/types/ITreeMultisetNode.html +1 -1
- package/docs/types/KeyValueObject.html +1 -1
- package/docs/types/KeyValueObjectWithId.html +1 -1
- package/docs/types/MapGraphCoordinate.html +1 -1
- package/docs/types/NavigatorParams.html +1 -1
- package/docs/types/NodeOrPropertyName.html +1 -1
- package/docs/types/NonNumberNonObjectButDefined.html +1 -1
- package/docs/types/ObjectWithNonNumberId.html +1 -1
- package/docs/types/ObjectWithNumberId.html +1 -1
- package/docs/types/ObjectWithoutId.html +1 -1
- package/docs/types/PriorityQueueComparator.html +1 -1
- package/docs/types/PriorityQueueDFSOrderPattern.html +1 -1
- package/docs/types/PriorityQueueOptions.html +1 -1
- package/docs/types/RBTreeNodeNested.html +1 -1
- package/docs/types/RBTreeOptions.html +1 -1
- package/docs/types/RestrictValById.html +1 -1
- package/docs/types/SegmentTreeNodeVal.html +1 -1
- package/docs/types/SpecifyOptional.html +1 -1
- package/docs/types/Thunk.html +1 -1
- package/docs/types/ToThunkFn.html +1 -1
- package/docs/types/TopologicalStatus.html +1 -1
- package/docs/types/TreeMultisetNodeNested.html +1 -1
- package/docs/types/TreeMultisetOptions.html +1 -1
- package/docs/types/TrlAsyncFn.html +1 -1
- package/docs/types/TrlFn.html +1 -1
- package/docs/types/Turning.html +1 -1
- package/docs/types/VertexId.html +1 -1
- package/docs/variables/THUNK_SYMBOL.html +1 -1
- package/jest.config.js +5 -3
- package/lib/data-structures/binary-tree/abstract-binary-tree.d.ts +169 -2
- package/lib/data-structures/binary-tree/abstract-binary-tree.js +31 -47
- package/package.json +26 -23
- package/test/unit/data-structures/linked-list/singly-linked-list.test.ts +1 -1
- package/test/unit/data-structures/priority-queue/max-priority-queue.test.ts +3 -1
- package/tsconfig.json +1 -1
- package/umd/bundle.min.js.map +1 -1
package/docs/classes/BST.html
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
<ul class="tsd-hierarchy">
|
|
35
35
|
<li><a href="../interfaces/IBST.html" class="tsd-signature-type tsd-kind-interface">IBST</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">></span></li></ul></section><aside class="tsd-sources">
|
|
36
36
|
<ul>
|
|
37
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
37
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/bst.ts#L28">src/data-structures/binary-tree/bst.ts:28</a></li></ul></aside>
|
|
38
38
|
<section class="tsd-panel-group tsd-index-group">
|
|
39
39
|
<section class="tsd-panel tsd-index-panel">
|
|
40
40
|
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
|
|
@@ -135,14 +135,14 @@
|
|
|
135
135
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
136
136
|
<p>Overrides <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#constructor">constructor</a></p>
|
|
137
137
|
<ul>
|
|
138
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
138
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/bst.ts#L33">src/data-structures/binary-tree/bst.ts:33</a></li></ul></aside></li></ul></section></section>
|
|
139
139
|
<section class="tsd-panel-group tsd-member-group">
|
|
140
140
|
<h2>Properties</h2>
|
|
141
141
|
<section class="tsd-panel tsd-member tsd-is-protected"><a id="_comparator" class="tsd-anchor"></a>
|
|
142
142
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_comparator</span><a href="#_comparator" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
143
143
|
<div class="tsd-signature"><span class="tsd-kind-property">_comparator</span><span class="tsd-signature-symbol">:</span> <a href="../types/BSTComparator.html" class="tsd-signature-type tsd-kind-type-alias">BSTComparator</a><span class="tsd-signature-symbol"> = ...</span></div><aside class="tsd-sources">
|
|
144
144
|
<ul>
|
|
145
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
145
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/bst.ts#L525">src/data-structures/binary-tree/bst.ts:525</a></li></ul></aside></section></section>
|
|
146
146
|
<section class="tsd-panel-group tsd-member-group">
|
|
147
147
|
<h2>Accessors</h2>
|
|
148
148
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="loopType" class="tsd-anchor"></a>
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
<p>Implementation of IBST.loopType</p>
|
|
155
155
|
<p>Inherited from BinaryTree.loopType</p>
|
|
156
156
|
<ul>
|
|
157
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
157
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L164">src/data-structures/binary-tree/abstract-binary-tree.ts:164</a></li></ul></aside></li></ul></section>
|
|
158
158
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="root" class="tsd-anchor"></a>
|
|
159
159
|
<h3 class="tsd-anchor-link"><span>root</span><a href="#root" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
160
160
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
<p>Implementation of IBST.root</p>
|
|
165
165
|
<p>Inherited from BinaryTree.root</p>
|
|
166
166
|
<ul>
|
|
167
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
167
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L152">src/data-structures/binary-tree/abstract-binary-tree.ts:152</a></li></ul></aside></li></ul></section>
|
|
168
168
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="size" class="tsd-anchor"></a>
|
|
169
169
|
<h3 class="tsd-anchor-link"><span>size</span><a href="#size" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
170
170
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
<p>Implementation of IBST.size</p>
|
|
175
175
|
<p>Inherited from BinaryTree.size</p>
|
|
176
176
|
<ul>
|
|
177
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
177
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L158">src/data-structures/binary-tree/abstract-binary-tree.ts:158</a></li></ul></aside></li></ul></section>
|
|
178
178
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="visitedId" class="tsd-anchor"></a>
|
|
179
179
|
<h3 class="tsd-anchor-link"><span>visited<wbr/>Id</span><a href="#visitedId" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
180
180
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -184,7 +184,7 @@
|
|
|
184
184
|
<p>Implementation of IBST.visitedId</p>
|
|
185
185
|
<p>Inherited from BinaryTree.visitedId</p>
|
|
186
186
|
<ul>
|
|
187
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
187
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L170">src/data-structures/binary-tree/abstract-binary-tree.ts:170</a></li></ul></aside></li></ul></section>
|
|
188
188
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="visitedLeftSum" class="tsd-anchor"></a>
|
|
189
189
|
<h3 class="tsd-anchor-link"><span>visited<wbr/>Left<wbr/>Sum</span><a href="#visitedLeftSum" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
190
190
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
<p>Implementation of IBST.visitedLeftSum</p>
|
|
195
195
|
<p>Inherited from BinaryTree.visitedLeftSum</p>
|
|
196
196
|
<ul>
|
|
197
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
197
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L188">src/data-structures/binary-tree/abstract-binary-tree.ts:188</a></li></ul></aside></li></ul></section>
|
|
198
198
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="visitedNode" class="tsd-anchor"></a>
|
|
199
199
|
<h3 class="tsd-anchor-link"><span>visited<wbr/>Node</span><a href="#visitedNode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
200
200
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -204,7 +204,7 @@
|
|
|
204
204
|
<p>Implementation of IBST.visitedNode</p>
|
|
205
205
|
<p>Inherited from BinaryTree.visitedNode</p>
|
|
206
206
|
<ul>
|
|
207
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
207
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L182">src/data-structures/binary-tree/abstract-binary-tree.ts:182</a></li></ul></aside></li></ul></section>
|
|
208
208
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="visitedVal" class="tsd-anchor"></a>
|
|
209
209
|
<h3 class="tsd-anchor-link"><span>visited<wbr/>Val</span><a href="#visitedVal" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
210
210
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
<p>Implementation of IBST.visitedVal</p>
|
|
215
215
|
<p>Inherited from BinaryTree.visitedVal</p>
|
|
216
216
|
<ul>
|
|
217
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
217
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L176">src/data-structures/binary-tree/abstract-binary-tree.ts:176</a></li></ul></aside></li></ul></section></section>
|
|
218
218
|
<section class="tsd-panel-group tsd-member-group">
|
|
219
219
|
<h2>Methods</h2>
|
|
220
220
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="BFS" class="tsd-anchor"></a>
|
|
@@ -222,290 +222,244 @@
|
|
|
222
222
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
223
223
|
<li class="tsd-signature tsd-anchor-link" id="BFS.BFS-1"><span class="tsd-kind-call-signature">BFS</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#BFS.BFS-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
224
224
|
<li class="tsd-description">
|
|
225
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
226
|
-
specified property name.</p>
|
|
225
|
+
<div class="tsd-comment tsd-typography"><p>Performs a breadth-first search (BFS) on a binary tree, accumulating properties of each node based on their 'id' property.</p>
|
|
227
226
|
</div>
|
|
228
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
227
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree node IDs.</p>
|
|
229
228
|
|
|
230
229
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
231
230
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#BFS">BFS</a></p>
|
|
232
231
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#BFS">BFS</a></p>
|
|
233
232
|
<ul>
|
|
234
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
233
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L925">src/data-structures/binary-tree/abstract-binary-tree.ts:925</a></li></ul></aside></li>
|
|
235
234
|
<li class="tsd-signature tsd-anchor-link" id="BFS.BFS-2"><span class="tsd-kind-call-signature">BFS</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#BFS.BFS-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
236
235
|
<li class="tsd-description">
|
|
237
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
238
|
-
specified property name.</p>
|
|
236
|
+
<div class="tsd-comment tsd-typography"><p>Performs a breadth-first search (BFS) on a binary tree, accumulating properties of each node based on the specified property name.</p>
|
|
239
237
|
</div>
|
|
240
238
|
<div class="tsd-parameters">
|
|
241
239
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
242
240
|
<ul class="tsd-parameter-list">
|
|
243
241
|
<li>
|
|
244
242
|
<h5><span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"id"</span></h5>
|
|
245
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
246
|
-
represents either a node or a property name. If a node is provided, the breadth-first search (BFS) algorithm will be
|
|
247
|
-
performed starting from that node. If a property name is provided, the BFS algorithm will be performed starting from
|
|
248
|
-
the</p>
|
|
243
|
+
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
|
|
249
244
|
</div>
|
|
250
245
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
251
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
246
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of values corresponding to the specified property.</p>
|
|
252
247
|
|
|
253
248
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
254
249
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#BFS">BFS</a></p>
|
|
255
250
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#BFS">BFS</a></p>
|
|
256
251
|
<ul>
|
|
257
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
252
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L932">src/data-structures/binary-tree/abstract-binary-tree.ts:932</a></li></ul></aside></li>
|
|
258
253
|
<li class="tsd-signature tsd-anchor-link" id="BFS.BFS-3"><span class="tsd-kind-call-signature">BFS</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"val"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span><a href="#BFS.BFS-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
259
254
|
<li class="tsd-description">
|
|
260
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
261
|
-
specified property name.</p>
|
|
255
|
+
<div class="tsd-comment tsd-typography"><p>Performs a breadth-first search (BFS) on a binary tree, accumulating the 'val' property of each node.</p>
|
|
262
256
|
</div>
|
|
263
257
|
<div class="tsd-parameters">
|
|
264
258
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
265
259
|
<ul class="tsd-parameter-list">
|
|
266
260
|
<li>
|
|
267
261
|
<h5><span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"val"</span></h5>
|
|
268
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
269
|
-
represents either a node or a property name. If a node is provided, the breadth-first search (BFS) algorithm will be
|
|
270
|
-
performed starting from that node. If a property name is provided, the BFS algorithm will be performed starting from
|
|
271
|
-
the</p>
|
|
262
|
+
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
|
|
272
263
|
</div>
|
|
273
264
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
274
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"val"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
265
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"val"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of 'val' properties from each node.</p>
|
|
275
266
|
|
|
276
267
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
277
268
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#BFS">BFS</a></p>
|
|
278
269
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#BFS">BFS</a></p>
|
|
279
270
|
<ul>
|
|
280
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
271
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L939">src/data-structures/binary-tree/abstract-binary-tree.ts:939</a></li></ul></aside></li>
|
|
281
272
|
<li class="tsd-signature tsd-anchor-link" id="BFS.BFS-4"><span class="tsd-kind-call-signature">BFS</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><a href="#BFS.BFS-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
282
273
|
<li class="tsd-description">
|
|
283
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
284
|
-
specified property name.</p>
|
|
274
|
+
<div class="tsd-comment tsd-typography"><p>Performs a breadth-first search (BFS) on a binary tree, accumulating nodes themselves.</p>
|
|
285
275
|
</div>
|
|
286
276
|
<div class="tsd-parameters">
|
|
287
277
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
288
278
|
<ul class="tsd-parameter-list">
|
|
289
279
|
<li>
|
|
290
280
|
<h5><span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"node"</span></h5>
|
|
291
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
292
|
-
represents either a node or a property name. If a node is provided, the breadth-first search (BFS) algorithm will be
|
|
293
|
-
performed starting from that node. If a property name is provided, the BFS algorithm will be performed starting from
|
|
294
|
-
the</p>
|
|
281
|
+
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
|
|
295
282
|
</div>
|
|
296
283
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
297
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
284
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree nodes.</p>
|
|
298
285
|
|
|
299
286
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
300
287
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#BFS">BFS</a></p>
|
|
301
288
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#BFS">BFS</a></p>
|
|
302
289
|
<ul>
|
|
303
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
290
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L946">src/data-structures/binary-tree/abstract-binary-tree.ts:946</a></li></ul></aside></li></ul></section>
|
|
304
291
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="DFS" class="tsd-anchor"></a>
|
|
305
292
|
<h3 class="tsd-anchor-link"><span>DFS</span><a href="#DFS" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
306
293
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
307
294
|
<li class="tsd-signature tsd-anchor-link" id="DFS.DFS-1"><span class="tsd-kind-call-signature">DFS</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#DFS.DFS-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
308
295
|
<li class="tsd-description">
|
|
309
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
310
|
-
each node based on the specified pattern and property name.</p>
|
|
296
|
+
<div class="tsd-comment tsd-typography"><p>Performs a depth-first search (DFS) traversal on a binary tree and accumulates properties of each node based on their 'id' property.</p>
|
|
311
297
|
</div>
|
|
312
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
313
|
-
binary tree nodes based on the specified pattern and node or property name.</p>
|
|
298
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree node IDs.</p>
|
|
314
299
|
|
|
315
300
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
316
301
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#DFS">DFS</a></p>
|
|
317
302
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#DFS">DFS</a></p>
|
|
318
303
|
<ul>
|
|
319
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
304
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L976">src/data-structures/binary-tree/abstract-binary-tree.ts:976</a></li></ul></aside></li>
|
|
320
305
|
<li class="tsd-signature tsd-anchor-link" id="DFS.DFS-2"><span class="tsd-kind-call-signature">DFS</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pattern</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#DFS.DFS-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
321
306
|
<li class="tsd-description">
|
|
322
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
323
|
-
each node based on the specified pattern and property name.</p>
|
|
307
|
+
<div class="tsd-comment tsd-typography"><p>Performs a depth-first search (DFS) traversal on a binary tree and accumulates properties of each node based on the specified property name.</p>
|
|
324
308
|
</div>
|
|
325
309
|
<div class="tsd-parameters">
|
|
326
310
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
327
311
|
<ul class="tsd-parameter-list">
|
|
328
312
|
<li>
|
|
329
313
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5>
|
|
330
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
331
|
-
binary tree. It can have three possible values:</p>
|
|
314
|
+
<div class="tsd-comment tsd-typography"><p>The traversal pattern: 'in' (in-order), 'pre' (pre-order), or 'post' (post-order).</p>
|
|
332
315
|
</div>
|
|
333
316
|
<div class="tsd-comment tsd-typography"></div></li>
|
|
334
317
|
<li>
|
|
335
318
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"id"</span></h5>
|
|
336
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
337
|
-
the name of a property of the nodes in the binary tree. This property will be used to accumulate values during the
|
|
338
|
-
depth-first search traversal. If no <code>nodeOrPropertyName</code> is provided, the default value is <code>'id'</code>.</p>
|
|
319
|
+
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
|
|
339
320
|
</div>
|
|
340
321
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
341
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
342
|
-
binary tree nodes based on the specified pattern and node or property name.</p>
|
|
322
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of values corresponding to the specified property.</p>
|
|
343
323
|
|
|
344
324
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
345
325
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#DFS">DFS</a></p>
|
|
346
326
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#DFS">DFS</a></p>
|
|
347
327
|
<ul>
|
|
348
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
328
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L984">src/data-structures/binary-tree/abstract-binary-tree.ts:984</a></li></ul></aside></li>
|
|
349
329
|
<li class="tsd-signature tsd-anchor-link" id="DFS.DFS-3"><span class="tsd-kind-call-signature">DFS</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pattern</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><a href="#DFS.DFS-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
350
330
|
<li class="tsd-description">
|
|
351
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
352
|
-
each node based on the specified pattern and property name.</p>
|
|
331
|
+
<div class="tsd-comment tsd-typography"><p>Performs a depth-first search (DFS) traversal on a binary tree and accumulates the 'val' property of each node.</p>
|
|
353
332
|
</div>
|
|
354
333
|
<div class="tsd-parameters">
|
|
355
334
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
356
335
|
<ul class="tsd-parameter-list">
|
|
357
336
|
<li>
|
|
358
337
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5>
|
|
359
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
360
|
-
binary tree. It can have three possible values:</p>
|
|
338
|
+
<div class="tsd-comment tsd-typography"><p>The traversal pattern: 'in' (in-order), 'pre' (pre-order), or 'post' (post-order).</p>
|
|
361
339
|
</div>
|
|
362
340
|
<div class="tsd-comment tsd-typography"></div></li>
|
|
363
341
|
<li>
|
|
364
342
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"val"</span></h5>
|
|
365
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
366
|
-
the name of a property of the nodes in the binary tree. This property will be used to accumulate values during the
|
|
367
|
-
depth-first search traversal. If no <code>nodeOrPropertyName</code> is provided, the default value is <code>'id'</code>.</p>
|
|
343
|
+
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
|
|
368
344
|
</div>
|
|
369
345
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
370
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
371
|
-
binary tree nodes based on the specified pattern and node or property name.</p>
|
|
346
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of 'val' properties from each node.</p>
|
|
372
347
|
|
|
373
348
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
374
349
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#DFS">DFS</a></p>
|
|
375
350
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#DFS">DFS</a></p>
|
|
376
351
|
<ul>
|
|
377
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
352
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L992">src/data-structures/binary-tree/abstract-binary-tree.ts:992</a></li></ul></aside></li>
|
|
378
353
|
<li class="tsd-signature tsd-anchor-link" id="DFS.DFS-4"><span class="tsd-kind-call-signature">DFS</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pattern</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><a href="#DFS.DFS-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
379
354
|
<li class="tsd-description">
|
|
380
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
381
|
-
each node based on the specified pattern and property name.</p>
|
|
355
|
+
<div class="tsd-comment tsd-typography"><p>Performs a depth-first search (DFS) traversal on a binary tree and accumulates nodes themselves.</p>
|
|
382
356
|
</div>
|
|
383
357
|
<div class="tsd-parameters">
|
|
384
358
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
385
359
|
<ul class="tsd-parameter-list">
|
|
386
360
|
<li>
|
|
387
361
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5>
|
|
388
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
389
|
-
binary tree. It can have three possible values:</p>
|
|
362
|
+
<div class="tsd-comment tsd-typography"><p>The traversal pattern: 'in' (in-order), 'pre' (pre-order), or 'post' (post-order).</p>
|
|
390
363
|
</div>
|
|
391
364
|
<div class="tsd-comment tsd-typography"></div></li>
|
|
392
365
|
<li>
|
|
393
366
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"node"</span></h5>
|
|
394
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
395
|
-
the name of a property of the nodes in the binary tree. This property will be used to accumulate values during the
|
|
396
|
-
depth-first search traversal. If no <code>nodeOrPropertyName</code> is provided, the default value is <code>'id'</code>.</p>
|
|
367
|
+
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
|
|
397
368
|
</div>
|
|
398
369
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
399
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
400
|
-
binary tree nodes based on the specified pattern and node or property name.</p>
|
|
370
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree nodes.</p>
|
|
401
371
|
|
|
402
372
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
403
373
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#DFS">DFS</a></p>
|
|
404
374
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#DFS">DFS</a></p>
|
|
405
375
|
<ul>
|
|
406
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
376
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1000">src/data-structures/binary-tree/abstract-binary-tree.ts:1000</a></li></ul></aside></li></ul></section>
|
|
407
377
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="DFSIterative" class="tsd-anchor"></a>
|
|
408
378
|
<h3 class="tsd-anchor-link"><span>DFSIterative</span><a href="#DFSIterative" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
409
379
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
410
380
|
<li class="tsd-signature tsd-anchor-link" id="DFSIterative.DFSIterative-1"><span class="tsd-kind-call-signature">DFSIterative</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#DFSIterative.DFSIterative-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
411
381
|
<li class="tsd-description">
|
|
412
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
413
|
-
specify the traversal pattern and the property name to accumulate results by.</p>
|
|
382
|
+
<div class="tsd-comment tsd-typography"><p>Performs an iterative depth-first search (DFS) traversal on a binary tree and accumulates properties of each node based on their 'id' property.</p>
|
|
414
383
|
</div>
|
|
415
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
384
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree node IDs.</p>
|
|
416
385
|
|
|
417
386
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
418
387
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#DFSIterative">DFSIterative</a></p>
|
|
419
388
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#DFSIterative">DFSIterative</a></p>
|
|
420
389
|
<ul>
|
|
421
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
390
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1043">src/data-structures/binary-tree/abstract-binary-tree.ts:1043</a></li></ul></aside></li>
|
|
422
391
|
<li class="tsd-signature tsd-anchor-link" id="DFSIterative.DFSIterative-2"><span class="tsd-kind-call-signature">DFSIterative</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pattern</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#DFSIterative.DFSIterative-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
423
392
|
<li class="tsd-description">
|
|
424
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
425
|
-
specify the traversal pattern and the property name to accumulate results by.</p>
|
|
393
|
+
<div class="tsd-comment tsd-typography"><p>Performs an iterative depth-first search (DFS) traversal on a binary tree and accumulates properties of each node based on the specified property name.</p>
|
|
426
394
|
</div>
|
|
427
395
|
<div class="tsd-parameters">
|
|
428
396
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
429
397
|
<ul class="tsd-parameter-list">
|
|
430
398
|
<li>
|
|
431
399
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5>
|
|
432
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
433
|
-
binary tree are visited during the depth-first search. It can have one of the following values:</p>
|
|
400
|
+
<div class="tsd-comment tsd-typography"><p>The traversal pattern: 'in' (in-order), 'pre' (pre-order), or 'post' (post-order).</p>
|
|
434
401
|
</div>
|
|
435
402
|
<div class="tsd-comment tsd-typography"></div></li>
|
|
436
403
|
<li>
|
|
437
404
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"id"</span></h5>
|
|
438
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
439
|
-
property of the nodes that you want to retrieve or perform operations on during the depth-first search traversal. By
|
|
440
|
-
default, it is set to <code>'id'</code>, which means that the traversal will accumulate results based on the <code>id</code> property of
|
|
441
|
-
the</p>
|
|
405
|
+
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
|
|
442
406
|
</div>
|
|
443
407
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
444
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
408
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of values corresponding to the specified property.</p>
|
|
445
409
|
|
|
446
410
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
447
411
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#DFSIterative">DFSIterative</a></p>
|
|
448
412
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#DFSIterative">DFSIterative</a></p>
|
|
449
413
|
<ul>
|
|
450
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
414
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1051">src/data-structures/binary-tree/abstract-binary-tree.ts:1051</a></li></ul></aside></li>
|
|
451
415
|
<li class="tsd-signature tsd-anchor-link" id="DFSIterative.DFSIterative-3"><span class="tsd-kind-call-signature">DFSIterative</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pattern</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><a href="#DFSIterative.DFSIterative-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
452
416
|
<li class="tsd-description">
|
|
453
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
454
|
-
specify the traversal pattern and the property name to accumulate results by.</p>
|
|
417
|
+
<div class="tsd-comment tsd-typography"><p>Performs an iterative depth-first search (DFS) traversal on a binary tree and accumulates the 'val' property of each node.</p>
|
|
455
418
|
</div>
|
|
456
419
|
<div class="tsd-parameters">
|
|
457
420
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
458
421
|
<ul class="tsd-parameter-list">
|
|
459
422
|
<li>
|
|
460
423
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5>
|
|
461
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
462
|
-
binary tree are visited during the depth-first search. It can have one of the following values:</p>
|
|
424
|
+
<div class="tsd-comment tsd-typography"><p>The traversal pattern: 'in' (in-order), 'pre' (pre-order), or 'post' (post-order).</p>
|
|
463
425
|
</div>
|
|
464
426
|
<div class="tsd-comment tsd-typography"></div></li>
|
|
465
427
|
<li>
|
|
466
428
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"val"</span></h5>
|
|
467
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
468
|
-
property of the nodes that you want to retrieve or perform operations on during the depth-first search traversal. By
|
|
469
|
-
default, it is set to <code>'id'</code>, which means that the traversal will accumulate results based on the <code>id</code> property of
|
|
470
|
-
the</p>
|
|
429
|
+
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
|
|
471
430
|
</div>
|
|
472
431
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
473
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
432
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of 'val' properties from each node.</p>
|
|
474
433
|
|
|
475
434
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
476
435
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#DFSIterative">DFSIterative</a></p>
|
|
477
436
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#DFSIterative">DFSIterative</a></p>
|
|
478
437
|
<ul>
|
|
479
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
438
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1059">src/data-structures/binary-tree/abstract-binary-tree.ts:1059</a></li></ul></aside></li>
|
|
480
439
|
<li class="tsd-signature tsd-anchor-link" id="DFSIterative.DFSIterative-4"><span class="tsd-kind-call-signature">DFSIterative</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pattern</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><a href="#DFSIterative.DFSIterative-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
481
440
|
<li class="tsd-description">
|
|
482
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
483
|
-
specify the traversal pattern and the property name to accumulate results by.</p>
|
|
441
|
+
<div class="tsd-comment tsd-typography"><p>Performs an iterative depth-first search (DFS) traversal on a binary tree and accumulates nodes themselves.</p>
|
|
484
442
|
</div>
|
|
485
443
|
<div class="tsd-parameters">
|
|
486
444
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
487
445
|
<ul class="tsd-parameter-list">
|
|
488
446
|
<li>
|
|
489
447
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5>
|
|
490
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
491
|
-
binary tree are visited during the depth-first search. It can have one of the following values:</p>
|
|
448
|
+
<div class="tsd-comment tsd-typography"><p>The traversal pattern: 'in' (in-order), 'pre' (pre-order), or 'post' (post-order).</p>
|
|
492
449
|
</div>
|
|
493
450
|
<div class="tsd-comment tsd-typography"></div></li>
|
|
494
451
|
<li>
|
|
495
452
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"node"</span></h5>
|
|
496
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
497
|
-
property of the nodes that you want to retrieve or perform operations on during the depth-first search traversal. By
|
|
498
|
-
default, it is set to <code>'id'</code>, which means that the traversal will accumulate results based on the <code>id</code> property of
|
|
499
|
-
the</p>
|
|
453
|
+
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
|
|
500
454
|
</div>
|
|
501
455
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
502
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
456
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree nodes.</p>
|
|
503
457
|
|
|
504
458
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
505
459
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#DFSIterative">DFSIterative</a></p>
|
|
506
460
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#DFSIterative">DFSIterative</a></p>
|
|
507
461
|
<ul>
|
|
508
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
462
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1067">src/data-structures/binary-tree/abstract-binary-tree.ts:1067</a></li></ul></aside></li></ul></section>
|
|
509
463
|
<section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="_accumulatedByPropertyName" class="tsd-anchor"></a>
|
|
510
464
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_accumulated<wbr/>By<wbr/>Property<wbr/>Name</span><a href="#_accumulatedByPropertyName" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
511
465
|
<ul class="tsd-signatures tsd-is-protected tsd-is-inherited">
|
|
@@ -532,7 +486,7 @@ specifies the property name to be used for accumulating values. If it is a <code
|
|
|
532
486
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
533
487
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#_accumulatedByPropertyName">_accumulatedByPropertyName</a></p>
|
|
534
488
|
<ul>
|
|
535
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
489
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1580">src/data-structures/binary-tree/abstract-binary-tree.ts:1580</a></li></ul></aside></li></ul></section>
|
|
536
490
|
<section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="_addTo" class="tsd-anchor"></a>
|
|
537
491
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_add<wbr/>To</span><a href="#_addTo" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
538
492
|
<ul class="tsd-signatures tsd-is-protected tsd-is-inherited">
|
|
@@ -562,7 +516,7 @@ undefined.</p>
|
|
|
562
516
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
563
517
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#_addTo">_addTo</a></p>
|
|
564
518
|
<ul>
|
|
565
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
519
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1434">src/data-structures/binary-tree/abstract-binary-tree.ts:1434</a></li></ul></aside></li></ul></section>
|
|
566
520
|
<section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="_clearResults" class="tsd-anchor"></a>
|
|
567
521
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_clear<wbr/>Results</span><a href="#_clearResults" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
568
522
|
<ul class="tsd-signatures tsd-is-protected tsd-is-inherited">
|
|
@@ -575,7 +529,7 @@ properties.</p>
|
|
|
575
529
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
576
530
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#_clearResults">_clearResults</a></p>
|
|
577
531
|
<ul>
|
|
578
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
532
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1522">src/data-structures/binary-tree/abstract-binary-tree.ts:1522</a></li></ul></aside></li></ul></section>
|
|
579
533
|
<section class="tsd-panel tsd-member tsd-is-protected"><a id="_compare" class="tsd-anchor"></a>
|
|
580
534
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_compare</span><a href="#_compare" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
581
535
|
<ul class="tsd-signatures tsd-is-protected">
|
|
@@ -602,7 +556,7 @@ than), or CP.eq (equal).</p>
|
|
|
602
556
|
|
|
603
557
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
604
558
|
<ul>
|
|
605
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
559
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/bst.ts#L535">src/data-structures/binary-tree/bst.ts:535</a></li></ul></aside></li></ul></section>
|
|
606
560
|
<section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="_getResultByPropertyName" class="tsd-anchor"></a>
|
|
607
561
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_get<wbr/>Result<wbr/>By<wbr/>Property<wbr/>Name</span><a href="#_getResultByPropertyName" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
608
562
|
<ul class="tsd-signatures tsd-is-protected tsd-is-inherited">
|
|
@@ -625,7 +579,7 @@ can accept either a <code>NodeOrPropertyName</code> type or be undefined.</p>
|
|
|
625
579
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
626
580
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#_getResultByPropertyName">_getResultByPropertyName</a></p>
|
|
627
581
|
<ul>
|
|
628
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
582
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1611">src/data-structures/binary-tree/abstract-binary-tree.ts:1611</a></li></ul></aside></li></ul></section>
|
|
629
583
|
<section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="_pushByPropertyNameStopOrNot" class="tsd-anchor"></a>
|
|
630
584
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_push<wbr/>By<wbr/>Property<wbr/>Name<wbr/>Stop<wbr/>Or<wbr/>Not</span><a href="#_pushByPropertyNameStopOrNot" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
631
585
|
<ul class="tsd-signatures tsd-is-protected tsd-is-inherited">
|
|
@@ -672,7 +626,7 @@ stop after finding the first matching node or continue searching for all matchin
|
|
|
672
626
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
673
627
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#_pushByPropertyNameStopOrNot">_pushByPropertyNameStopOrNot</a></p>
|
|
674
628
|
<ul>
|
|
675
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
629
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1544">src/data-structures/binary-tree/abstract-binary-tree.ts:1544</a></li></ul></aside></li></ul></section>
|
|
676
630
|
<section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="_setLoopType" class="tsd-anchor"></a>
|
|
677
631
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_set<wbr/>Loop<wbr/>Type</span><a href="#_setLoopType" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
678
632
|
<ul class="tsd-signatures tsd-is-protected tsd-is-inherited">
|
|
@@ -692,7 +646,7 @@ stop after finding the first matching node or continue searching for all matchin
|
|
|
692
646
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
693
647
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#_setLoopType">_setLoopType</a></p>
|
|
694
648
|
<ul>
|
|
695
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
649
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1462">src/data-structures/binary-tree/abstract-binary-tree.ts:1462</a></li></ul></aside></li></ul></section>
|
|
696
650
|
<section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="_setRoot" class="tsd-anchor"></a>
|
|
697
651
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_set<wbr/>Root</span><a href="#_setRoot" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
698
652
|
<ul class="tsd-signatures tsd-is-protected tsd-is-inherited">
|
|
@@ -713,7 +667,7 @@ parent property of the value to undefined.</p>
|
|
|
713
667
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
714
668
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#_setRoot">_setRoot</a></p>
|
|
715
669
|
<ul>
|
|
716
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
670
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1503">src/data-structures/binary-tree/abstract-binary-tree.ts:1503</a></li></ul></aside></li></ul></section>
|
|
717
671
|
<section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="_setSize" class="tsd-anchor"></a>
|
|
718
672
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_set<wbr/>Size</span><a href="#_setSize" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
719
673
|
<ul class="tsd-signatures tsd-is-protected tsd-is-inherited">
|
|
@@ -733,7 +687,7 @@ parent property of the value to undefined.</p>
|
|
|
733
687
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
734
688
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#_setSize">_setSize</a></p>
|
|
735
689
|
<ul>
|
|
736
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
690
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1514">src/data-structures/binary-tree/abstract-binary-tree.ts:1514</a></li></ul></aside></li></ul></section>
|
|
737
691
|
<section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="_setVisitedId" class="tsd-anchor"></a>
|
|
738
692
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_set<wbr/>Visited<wbr/>Id</span><a href="#_setVisitedId" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
739
693
|
<ul class="tsd-signatures tsd-is-protected tsd-is-inherited">
|
|
@@ -753,7 +707,7 @@ parent property of the value to undefined.</p>
|
|
|
753
707
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
754
708
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#_setVisitedId">_setVisitedId</a></p>
|
|
755
709
|
<ul>
|
|
756
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
710
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1470">src/data-structures/binary-tree/abstract-binary-tree.ts:1470</a></li></ul></aside></li></ul></section>
|
|
757
711
|
<section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="_setVisitedLeftSum" class="tsd-anchor"></a>
|
|
758
712
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_set<wbr/>Visited<wbr/>Left<wbr/>Sum</span><a href="#_setVisitedLeftSum" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
759
713
|
<ul class="tsd-signatures tsd-is-protected tsd-is-inherited">
|
|
@@ -773,7 +727,7 @@ parent property of the value to undefined.</p>
|
|
|
773
727
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
774
728
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#_setVisitedLeftSum">_setVisitedLeftSum</a></p>
|
|
775
729
|
<ul>
|
|
776
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
730
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1494">src/data-structures/binary-tree/abstract-binary-tree.ts:1494</a></li></ul></aside></li></ul></section>
|
|
777
731
|
<section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="_setVisitedNode" class="tsd-anchor"></a>
|
|
778
732
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_set<wbr/>Visited<wbr/>Node</span><a href="#_setVisitedNode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
779
733
|
<ul class="tsd-signatures tsd-is-protected tsd-is-inherited">
|
|
@@ -793,7 +747,7 @@ parent property of the value to undefined.</p>
|
|
|
793
747
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
794
748
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#_setVisitedNode">_setVisitedNode</a></p>
|
|
795
749
|
<ul>
|
|
796
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
750
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1486">src/data-structures/binary-tree/abstract-binary-tree.ts:1486</a></li></ul></aside></li></ul></section>
|
|
797
751
|
<section class="tsd-panel tsd-member tsd-is-protected tsd-is-inherited"><a id="_setVisitedVal" class="tsd-anchor"></a>
|
|
798
752
|
<h3 class="tsd-anchor-link"><code class="tsd-tag ts-flagProtected">Protected</code> <span>_set<wbr/>Visited<wbr/>Val</span><a href="#_setVisitedVal" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
799
753
|
<ul class="tsd-signatures tsd-is-protected tsd-is-inherited">
|
|
@@ -813,7 +767,7 @@ parent property of the value to undefined.</p>
|
|
|
813
767
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
814
768
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#_setVisitedVal">_setVisitedVal</a></p>
|
|
815
769
|
<ul>
|
|
816
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
770
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1478">src/data-structures/binary-tree/abstract-binary-tree.ts:1478</a></li></ul></aside></li></ul></section>
|
|
817
771
|
<section class="tsd-panel tsd-member"><a id="add" class="tsd-anchor"></a>
|
|
818
772
|
<h3 class="tsd-anchor-link"><span>add</span><a href="#add" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
819
773
|
<ul class="tsd-signatures">
|
|
@@ -843,7 +797,7 @@ being added to the binary search tree.</p>
|
|
|
843
797
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#add">add</a></p>
|
|
844
798
|
<p>Overrides <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#add">add</a></p>
|
|
845
799
|
<ul>
|
|
846
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
800
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/bst.ts#L64">src/data-structures/binary-tree/bst.ts:64</a></li></ul></aside></li></ul></section>
|
|
847
801
|
<section class="tsd-panel tsd-member"><a id="addMany" class="tsd-anchor"></a>
|
|
848
802
|
<h3 class="tsd-anchor-link"><span>add<wbr/>Many</span><a href="#addMany" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
849
803
|
<ul class="tsd-signatures">
|
|
@@ -878,7 +832,7 @@ to the binary search tree.</p>
|
|
|
878
832
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#addMany">addMany</a></p>
|
|
879
833
|
<p>Overrides <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#addMany">addMany</a></p>
|
|
880
834
|
<ul>
|
|
881
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
835
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/bst.ts#L140">src/data-structures/binary-tree/bst.ts:140</a></li></ul></aside></li></ul></section>
|
|
882
836
|
<section class="tsd-panel tsd-member"><a id="allGreaterNodesAdd" class="tsd-anchor"></a>
|
|
883
837
|
<h3 class="tsd-anchor-link"><span>all<wbr/>Greater<wbr/>Nodes<wbr/>Add</span><a href="#allGreaterNodesAdd" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
884
838
|
<ul class="tsd-signatures">
|
|
@@ -914,7 +868,7 @@ specifies the property name of the nodes in the binary tree that you want to upd
|
|
|
914
868
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
915
869
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#allGreaterNodesAdd">allGreaterNodesAdd</a></p>
|
|
916
870
|
<ul>
|
|
917
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
871
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/bst.ts#L376">src/data-structures/binary-tree/bst.ts:376</a></li></ul></aside></li></ul></section>
|
|
918
872
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="clear" class="tsd-anchor"></a>
|
|
919
873
|
<h3 class="tsd-anchor-link"><span>clear</span><a href="#clear" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
920
874
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -927,7 +881,7 @@ specifies the property name of the nodes in the binary tree that you want to upd
|
|
|
927
881
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#clear">clear</a></p>
|
|
928
882
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#clear">clear</a></p>
|
|
929
883
|
<ul>
|
|
930
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
884
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L223">src/data-structures/binary-tree/abstract-binary-tree.ts:223</a></li></ul></aside></li></ul></section>
|
|
931
885
|
<section class="tsd-panel tsd-member"><a id="createNode" class="tsd-anchor"></a>
|
|
932
886
|
<h3 class="tsd-anchor-link"><span>create<wbr/>Node</span><a href="#createNode" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
933
887
|
<ul class="tsd-signatures">
|
|
@@ -956,7 +910,7 @@ that will be stored in the node.</p>
|
|
|
956
910
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#createNode">createNode</a></p>
|
|
957
911
|
<p>Overrides <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#createNode">createNode</a></p>
|
|
958
912
|
<ul>
|
|
959
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
913
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/bst.ts#L51">src/data-structures/binary-tree/bst.ts:51</a></li></ul></aside></li></ul></section>
|
|
960
914
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="fill" class="tsd-anchor"></a>
|
|
961
915
|
<h3 class="tsd-anchor-link"><span>fill</span><a href="#fill" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
962
916
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -986,7 +940,7 @@ array. Each value in the <code>data</code> array will be assigned to the</p>
|
|
|
986
940
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#fill">fill</a></p>
|
|
987
941
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#fill">fill</a></p>
|
|
988
942
|
<ul>
|
|
989
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
943
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L341">src/data-structures/binary-tree/abstract-binary-tree.ts:341</a></li></ul></aside></li></ul></section>
|
|
990
944
|
<section class="tsd-panel tsd-member"><a id="get" class="tsd-anchor"></a>
|
|
991
945
|
<h3 class="tsd-anchor-link"><span>get</span><a href="#get" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
992
946
|
<ul class="tsd-signatures">
|
|
@@ -1015,7 +969,7 @@ specifies the property name to use for searching the binary tree nodes. If not p
|
|
|
1015
969
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#get">get</a></p>
|
|
1016
970
|
<p>Overrides <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#get">get</a></p>
|
|
1017
971
|
<ul>
|
|
1018
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
972
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/bst.ts#L217">src/data-structures/binary-tree/bst.ts:217</a></li></ul></aside></li></ul></section>
|
|
1019
973
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="getDepth" class="tsd-anchor"></a>
|
|
1020
974
|
<h3 class="tsd-anchor-link"><span>get<wbr/>Depth</span><a href="#getDepth" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1021
975
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -1037,7 +991,7 @@ specifies the property name to use for searching the binary tree nodes. If not p
|
|
|
1037
991
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#getDepth">getDepth</a></p>
|
|
1038
992
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#getDepth">getDepth</a></p>
|
|
1039
993
|
<ul>
|
|
1040
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
994
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L408">src/data-structures/binary-tree/abstract-binary-tree.ts:408</a></li></ul></aside></li></ul></section>
|
|
1041
995
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="getHeight" class="tsd-anchor"></a>
|
|
1042
996
|
<h3 class="tsd-anchor-link"><span>get<wbr/>Height</span><a href="#getHeight" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1043
997
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -1061,43 +1015,52 @@ node), or <code>null</code>.</p>
|
|
|
1061
1015
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#getHeight">getHeight</a></p>
|
|
1062
1016
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#getHeight">getHeight</a></p>
|
|
1063
1017
|
<ul>
|
|
1064
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1018
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L426">src/data-structures/binary-tree/abstract-binary-tree.ts:426</a></li></ul></aside></li></ul></section>
|
|
1065
1019
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="getLeftMost" class="tsd-anchor"></a>
|
|
1066
1020
|
<h3 class="tsd-anchor-link"><span>get<wbr/>Left<wbr/>Most</span><a href="#getLeftMost" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1067
1021
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
1068
1022
|
<li class="tsd-signature tsd-anchor-link" id="getLeftMost.getLeftMost-1"><span class="tsd-kind-call-signature">get<wbr/>Left<wbr/>Most</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><a href="#getLeftMost.getLeftMost-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
1069
1023
|
<li class="tsd-description">
|
|
1070
|
-
<div class="tsd-comment tsd-typography"><p>The <code>getLeftMost</code>
|
|
1071
|
-
no node is specified
|
|
1024
|
+
<div class="tsd-comment tsd-typography"><p>The function <code>getLeftMost</code> returns the leftmost node in a binary tree, starting from a specified node or the root if
|
|
1025
|
+
no node is specified.
|
|
1026
|
+
generic type representing a node in a binary tree), <code>BinaryTreeNodeId</code> (a type representing the ID of a binary tree
|
|
1027
|
+
node), or <code>null</code>.</p>
|
|
1072
1028
|
</div>
|
|
1073
1029
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h4><p>The function <code>getLeftMost</code> returns the leftmost node in a binary tree. If the <code>beginRoot</code> parameter is
|
|
1074
|
-
provided, it starts the traversal from that node. If <code>beginRoot</code> is not provided or is <code>null</code>, it starts the
|
|
1075
|
-
|
|
1030
|
+
provided, it starts the traversal from that node. If <code>beginRoot</code> is not provided or is <code>null</code>, it starts the traversal
|
|
1031
|
+
from the root of the binary tree. The function returns the leftmost node found during the traversal. If no leftmost
|
|
1032
|
+
node is found (</p>
|
|
1076
1033
|
|
|
1077
1034
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1078
1035
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#getLeftMost">getLeftMost</a></p>
|
|
1079
1036
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#getLeftMost">getLeftMost</a></p>
|
|
1080
1037
|
<ul>
|
|
1081
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1082
|
-
<li class="tsd-signature tsd-anchor-link" id="getLeftMost.getLeftMost-2"><span class="tsd-kind-call-signature">get<wbr/>Left<wbr/>Most</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><a href="#getLeftMost.getLeftMost-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
1038
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L634">src/data-structures/binary-tree/abstract-binary-tree.ts:634</a></li></ul></aside></li>
|
|
1039
|
+
<li class="tsd-signature tsd-anchor-link" id="getLeftMost.getLeftMost-2"><span class="tsd-kind-call-signature">get<wbr/>Left<wbr/>Most</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><a href="#getLeftMost.getLeftMost-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
1083
1040
|
<li class="tsd-description">
|
|
1084
|
-
<div class="tsd-comment tsd-typography"><p>The <code>getLeftMost</code>
|
|
1041
|
+
<div class="tsd-comment tsd-typography"><p>The function <code>getLeftMost</code> returns the leftmost node in a binary tree, starting from a specified node or the root if
|
|
1085
1042
|
no node is specified.</p>
|
|
1086
1043
|
</div>
|
|
1087
1044
|
<div class="tsd-parameters">
|
|
1088
1045
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
1089
1046
|
<ul class="tsd-parameter-list">
|
|
1090
1047
|
<li>
|
|
1091
|
-
<h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5
|
|
1048
|
+
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
|
|
1049
|
+
<div class="tsd-comment tsd-typography"><p>The <code>beginRoot</code> parameter is optional and can be of type <code>N</code> (a
|
|
1050
|
+
generic type representing a node in a binary tree), <code>BinaryTreeNodeId</code> (a type representing the ID of a binary tree
|
|
1051
|
+
node).</p>
|
|
1052
|
+
</div>
|
|
1053
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
1092
1054
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span></h4><p>The function <code>getLeftMost</code> returns the leftmost node in a binary tree. If the <code>beginRoot</code> parameter is
|
|
1093
|
-
provided, it starts the traversal from that node. If <code>beginRoot</code> is not provided or is <code>null</code>, it starts the
|
|
1094
|
-
|
|
1055
|
+
provided, it starts the traversal from that node. If <code>beginRoot</code> is not provided or is <code>null</code>, it starts the traversal
|
|
1056
|
+
from the root of the binary tree. The function returns the leftmost node found during the traversal. If no leftmost
|
|
1057
|
+
node is found (</p>
|
|
1095
1058
|
|
|
1096
1059
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1097
1060
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#getLeftMost">getLeftMost</a></p>
|
|
1098
1061
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#getLeftMost">getLeftMost</a></p>
|
|
1099
1062
|
<ul>
|
|
1100
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1063
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L647">src/data-structures/binary-tree/abstract-binary-tree.ts:647</a></li></ul></aside></li></ul></section>
|
|
1101
1064
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="getMinHeight" class="tsd-anchor"></a>
|
|
1102
1065
|
<h3 class="tsd-anchor-link"><span>get<wbr/>Min<wbr/>Height</span><a href="#getMinHeight" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1103
1066
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -1122,7 +1085,7 @@ for <code>beginRoot</code>, the <code>this.root</code> property is used as the d
|
|
|
1122
1085
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#getMinHeight">getMinHeight</a></p>
|
|
1123
1086
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#getMinHeight">getMinHeight</a></p>
|
|
1124
1087
|
<ul>
|
|
1125
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1088
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L475">src/data-structures/binary-tree/abstract-binary-tree.ts:475</a></li></ul></aside></li></ul></section>
|
|
1126
1089
|
<section class="tsd-panel tsd-member"><a id="getNodes" class="tsd-anchor"></a>
|
|
1127
1090
|
<h3 class="tsd-anchor-link"><span>get<wbr/>Nodes</span><a href="#getNodes" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1128
1091
|
<ul class="tsd-signatures">
|
|
@@ -1158,7 +1121,7 @@ is set to <code>true</code>, the function will return an array with only one nod
|
|
|
1158
1121
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#getNodes">getNodes</a></p>
|
|
1159
1122
|
<p>Overrides <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#getNodes">getNodes</a></p>
|
|
1160
1123
|
<ul>
|
|
1161
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1124
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/bst.ts#L246">src/data-structures/binary-tree/bst.ts:246</a></li></ul></aside></li></ul></section>
|
|
1162
1125
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="getPathToRoot" class="tsd-anchor"></a>
|
|
1163
1126
|
<h3 class="tsd-anchor-link"><span>get<wbr/>Path<wbr/>To<wbr/>Root</span><a href="#getPathToRoot" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1164
1127
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -1189,7 +1152,7 @@ path should be reversed or not. If <code>isReverse</code> is set to <code>true</
|
|
|
1189
1152
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#getPathToRoot">getPathToRoot</a></p>
|
|
1190
1153
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#getPathToRoot">getPathToRoot</a></p>
|
|
1191
1154
|
<ul>
|
|
1192
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1155
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L611">src/data-structures/binary-tree/abstract-binary-tree.ts:611</a></li></ul></aside></li></ul></section>
|
|
1193
1156
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="getPredecessor" class="tsd-anchor"></a>
|
|
1194
1157
|
<h3 class="tsd-anchor-link"><span>get<wbr/>Predecessor</span><a href="#getPredecessor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1195
1158
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -1211,48 +1174,46 @@ path should be reversed or not. If <code>isReverse</code> is set to <code>true</
|
|
|
1211
1174
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#getPredecessor">getPredecessor</a></p>
|
|
1212
1175
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#getPredecessor">getPredecessor</a></p>
|
|
1213
1176
|
<ul>
|
|
1214
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1177
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1280">src/data-structures/binary-tree/abstract-binary-tree.ts:1280</a></li></ul></aside></li></ul></section>
|
|
1215
1178
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="getRightMost" class="tsd-anchor"></a>
|
|
1216
1179
|
<h3 class="tsd-anchor-link"><span>get<wbr/>Right<wbr/>Most</span><a href="#getRightMost" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1217
1180
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
1218
1181
|
<li class="tsd-signature tsd-anchor-link" id="getRightMost.getRightMost-1"><span class="tsd-kind-call-signature">get<wbr/>Right<wbr/>Most</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><a href="#getRightMost.getRightMost-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
1219
1182
|
<li class="tsd-description">
|
|
1220
|
-
<div class="tsd-comment tsd-typography"><p>The <code>getRightMost</code> function returns the rightmost node in a binary tree, either recursively or iteratively using
|
|
1221
|
-
|
|
1183
|
+
<div class="tsd-comment tsd-typography"><p>The <code>getRightMost</code> function returns the rightmost node in a binary tree, either recursively or iteratively using tail
|
|
1184
|
+
recursion optimization.</p>
|
|
1222
1185
|
</div>
|
|
1223
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h4><p>The
|
|
1224
|
-
|
|
1225
|
-
function returns <code>null</code>.</p>
|
|
1186
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h4><p>The <code>getRightMost</code> function returns the rightmost node in a binary tree. It returns the
|
|
1187
|
+
rightmost node starting from the root of the binary tree.</p>
|
|
1226
1188
|
|
|
1227
1189
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1228
1190
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#getRightMost">getRightMost</a></p>
|
|
1229
1191
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#getRightMost">getRightMost</a></p>
|
|
1230
1192
|
<ul>
|
|
1231
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1232
|
-
<li class="tsd-signature tsd-anchor-link" id="getRightMost.getRightMost-2"><span class="tsd-kind-call-signature">get<wbr/>Right<wbr/>Most</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><a href="#getRightMost.getRightMost-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
1193
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L690">src/data-structures/binary-tree/abstract-binary-tree.ts:690</a></li></ul></aside></li>
|
|
1194
|
+
<li class="tsd-signature tsd-anchor-link" id="getRightMost.getRightMost-2"><span class="tsd-kind-call-signature">get<wbr/>Right<wbr/>Most</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><a href="#getRightMost.getRightMost-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
1233
1195
|
<li class="tsd-description">
|
|
1234
|
-
<div class="tsd-comment tsd-typography"><p>The <code>getRightMost</code> function returns the rightmost node in a binary tree, either recursively or iteratively using
|
|
1235
|
-
|
|
1196
|
+
<div class="tsd-comment tsd-typography"><p>The <code>getRightMost</code> function returns the rightmost node in a binary tree, either recursively or iteratively using tail
|
|
1197
|
+
recursion optimization.</p>
|
|
1236
1198
|
</div>
|
|
1237
1199
|
<div class="tsd-parameters">
|
|
1238
1200
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
1239
1201
|
<ul class="tsd-parameter-list">
|
|
1240
1202
|
<li>
|
|
1241
|
-
<h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
|
|
1203
|
+
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
|
|
1242
1204
|
<div class="tsd-comment tsd-typography"><p>The <code>node</code> parameter is an optional parameter of type <code>N</code> or <code>null</code>. It represents the
|
|
1243
|
-
starting node from which we want to find the rightmost node. If no node is provided, the
|
|
1244
|
-
|
|
1205
|
+
starting node from which we want to find the rightmost node. If no node is provided, the function will default to
|
|
1206
|
+
using the root node of the data structure.</p>
|
|
1245
1207
|
</div>
|
|
1246
1208
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
1247
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span></h4><p>The
|
|
1248
|
-
|
|
1249
|
-
function returns <code>null</code>.</p>
|
|
1209
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span></h4><p>The <code>getRightMost</code> function returns the rightmost node in a binary tree. It returns the rightmost node
|
|
1210
|
+
starting from that node.</p>
|
|
1250
1211
|
|
|
1251
1212
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1252
1213
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#getRightMost">getRightMost</a></p>
|
|
1253
1214
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#getRightMost">getRightMost</a></p>
|
|
1254
1215
|
<ul>
|
|
1255
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1216
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L701">src/data-structures/binary-tree/abstract-binary-tree.ts:701</a></li></ul></aside></li></ul></section>
|
|
1256
1217
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="getSubTreeSize" class="tsd-anchor"></a>
|
|
1257
1218
|
<h3 class="tsd-anchor-link"><span>get<wbr/>Sub<wbr/>Tree<wbr/>Size</span><a href="#getSubTreeSize" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1258
1219
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -1275,7 +1236,7 @@ binary tree.</p>
|
|
|
1275
1236
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#getSubTreeSize">getSubTreeSize</a></p>
|
|
1276
1237
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#getSubTreeSize">getSubTreeSize</a></p>
|
|
1277
1238
|
<ul>
|
|
1278
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1239
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L785">src/data-structures/binary-tree/abstract-binary-tree.ts:785</a></li></ul></aside></li></ul></section>
|
|
1279
1240
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="has" class="tsd-anchor"></a>
|
|
1280
1241
|
<h3 class="tsd-anchor-link"><span>has</span><a href="#has" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1281
1242
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -1304,7 +1265,7 @@ specifies the name of the property to be checked in the nodes. If not provided,
|
|
|
1304
1265
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#has">has</a></p>
|
|
1305
1266
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#has">has</a></p>
|
|
1306
1267
|
<ul>
|
|
1307
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1268
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L578">src/data-structures/binary-tree/abstract-binary-tree.ts:578</a></li></ul></aside></li></ul></section>
|
|
1308
1269
|
<section class="tsd-panel tsd-member"><a id="isAVLBalanced" class="tsd-anchor"></a>
|
|
1309
1270
|
<h3 class="tsd-anchor-link"><span>isAVLBalanced</span><a href="#isAVLBalanced" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1310
1271
|
<ul class="tsd-signatures">
|
|
@@ -1317,7 +1278,7 @@ specifies the name of the property to be checked in the nodes. If not provided,
|
|
|
1317
1278
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1318
1279
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#isAVLBalanced">isAVLBalanced</a></p>
|
|
1319
1280
|
<ul>
|
|
1320
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1281
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/bst.ts#L481">src/data-structures/binary-tree/bst.ts:481</a></li></ul></aside></li></ul></section>
|
|
1321
1282
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="isBST" class="tsd-anchor"></a>
|
|
1322
1283
|
<h3 class="tsd-anchor-link"><span>isBST</span><a href="#isBST" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1323
1284
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -1331,7 +1292,7 @@ specifies the name of the property to be checked in the nodes. If not provided,
|
|
|
1331
1292
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#isBST">isBST</a></p>
|
|
1332
1293
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#isBST">isBST</a></p>
|
|
1333
1294
|
<ul>
|
|
1334
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1295
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L775">src/data-structures/binary-tree/abstract-binary-tree.ts:775</a></li></ul></aside></li></ul></section>
|
|
1335
1296
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="isEmpty" class="tsd-anchor"></a>
|
|
1336
1297
|
<h3 class="tsd-anchor-link"><span>is<wbr/>Empty</span><a href="#isEmpty" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1337
1298
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -1345,7 +1306,7 @@ specifies the name of the property to be checked in the nodes. If not provided,
|
|
|
1345
1306
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#isEmpty">isEmpty</a></p>
|
|
1346
1307
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#isEmpty">isEmpty</a></p>
|
|
1347
1308
|
<ul>
|
|
1348
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1309
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L233">src/data-structures/binary-tree/abstract-binary-tree.ts:233</a></li></ul></aside></li></ul></section>
|
|
1349
1310
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="isPerfectlyBalanced" class="tsd-anchor"></a>
|
|
1350
1311
|
<h3 class="tsd-anchor-link"><span>is<wbr/>Perfectly<wbr/>Balanced</span><a href="#isPerfectlyBalanced" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1351
1312
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -1369,7 +1330,7 @@ tree or null if the tree is empty.</p>
|
|
|
1369
1330
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#isPerfectlyBalanced">isPerfectlyBalanced</a></p>
|
|
1370
1331
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#isPerfectlyBalanced">isPerfectlyBalanced</a></p>
|
|
1371
1332
|
<ul>
|
|
1372
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1333
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L525">src/data-structures/binary-tree/abstract-binary-tree.ts:525</a></li></ul></aside></li></ul></section>
|
|
1373
1334
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="isSubtreeBST" class="tsd-anchor"></a>
|
|
1374
1335
|
<h3 class="tsd-anchor-link"><span>is<wbr/>SubtreeBST</span><a href="#isSubtreeBST" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1375
1336
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -1391,7 +1352,7 @@ tree or null if the tree is empty.</p>
|
|
|
1391
1352
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#isSubtreeBST">isSubtreeBST</a></p>
|
|
1392
1353
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#isSubtreeBST">isSubtreeBST</a></p>
|
|
1393
1354
|
<ul>
|
|
1394
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1355
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L741">src/data-structures/binary-tree/abstract-binary-tree.ts:741</a></li></ul></aside></li></ul></section>
|
|
1395
1356
|
<section class="tsd-panel tsd-member"><a id="lastKey" class="tsd-anchor"></a>
|
|
1396
1357
|
<h3 class="tsd-anchor-link"><span>last<wbr/>Key</span><a href="#lastKey" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1397
1358
|
<ul class="tsd-signatures">
|
|
@@ -1407,7 +1368,7 @@ equal, it returns the id of the rightmost node. If there are no nodes in the tre
|
|
|
1407
1368
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1408
1369
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#lastKey">lastKey</a></p>
|
|
1409
1370
|
<ul>
|
|
1410
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1371
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/bst.ts#L229">src/data-structures/binary-tree/bst.ts:229</a></li></ul></aside></li></ul></section>
|
|
1411
1372
|
<section class="tsd-panel tsd-member"><a id="lesserSum" class="tsd-anchor"></a>
|
|
1412
1373
|
<h3 class="tsd-anchor-link"><span>lesser<wbr/>Sum</span><a href="#lesserSum" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1413
1374
|
<ul class="tsd-signatures">
|
|
@@ -1436,315 +1397,277 @@ binary tree that have a lesser value than the specified <code>beginNode</code> b
|
|
|
1436
1397
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1437
1398
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#lesserSum">lesserSum</a></p>
|
|
1438
1399
|
<ul>
|
|
1439
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1400
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/bst.ts#L299">src/data-structures/binary-tree/bst.ts:299</a></li></ul></aside></li></ul></section>
|
|
1440
1401
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="levelIterative" class="tsd-anchor"></a>
|
|
1441
1402
|
<h3 class="tsd-anchor-link"><span>level<wbr/>Iterative</span><a href="#levelIterative" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1442
1403
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
1443
1404
|
<li class="tsd-signature tsd-anchor-link" id="levelIterative.levelIterative-1"><span class="tsd-kind-call-signature">level<wbr/>Iterative</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#levelIterative.levelIterative-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
1444
1405
|
<li class="tsd-description">
|
|
1445
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
1446
|
-
in an array, based on a specified property name.</p>
|
|
1406
|
+
<div class="tsd-comment tsd-typography"><p>Performs a level-order traversal on a binary tree starting from the specified node and accumulates properties of each node based on their 'id' property.</p>
|
|
1447
1407
|
</div>
|
|
1448
1408
|
<div class="tsd-parameters">
|
|
1449
1409
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
1450
1410
|
<ul class="tsd-parameter-list">
|
|
1451
1411
|
<li>
|
|
1452
1412
|
<h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
|
|
1453
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
1454
|
-
node for the level order traversal. It can be null if no specific node is provided, in which case the root node of
|
|
1455
|
-
the tree is used as the starting node.</p>
|
|
1413
|
+
<div class="tsd-comment tsd-typography"><p>The starting node for the level order traversal. If null, the root node of the tree is used as the starting node.</p>
|
|
1456
1414
|
</div>
|
|
1457
1415
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
1458
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
1416
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree node IDs.</p>
|
|
1459
1417
|
|
|
1460
1418
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1461
1419
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#levelIterative">levelIterative</a></p>
|
|
1462
1420
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#levelIterative">levelIterative</a></p>
|
|
1463
1421
|
<ul>
|
|
1464
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1422
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1126">src/data-structures/binary-tree/abstract-binary-tree.ts:1126</a></li></ul></aside></li>
|
|
1465
1423
|
<li class="tsd-signature tsd-anchor-link" id="levelIterative.levelIterative-2"><span class="tsd-kind-call-signature">level<wbr/>Iterative</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#levelIterative.levelIterative-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
1466
1424
|
<li class="tsd-description">
|
|
1467
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
1468
|
-
in an array, based on a specified property name.</p>
|
|
1425
|
+
<div class="tsd-comment tsd-typography"><p>Performs a level-order traversal on a binary tree starting from the specified node and accumulates properties of each node based on the specified property name.</p>
|
|
1469
1426
|
</div>
|
|
1470
1427
|
<div class="tsd-parameters">
|
|
1471
1428
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
1472
1429
|
<ul class="tsd-parameter-list">
|
|
1473
1430
|
<li>
|
|
1474
1431
|
<h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
|
|
1475
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
1476
|
-
node for the level order traversal. It can be null if no specific node is provided, in which case the root node of
|
|
1477
|
-
the tree is used as the starting node.</p>
|
|
1432
|
+
<div class="tsd-comment tsd-typography"><p>The starting node for the level order traversal. If null, the root node of the tree is used as the starting node.</p>
|
|
1478
1433
|
</div>
|
|
1479
1434
|
<div class="tsd-comment tsd-typography"></div></li>
|
|
1480
1435
|
<li>
|
|
1481
1436
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"id"</span></h5>
|
|
1482
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
1483
|
-
can be either a <code>BinaryTreeNode</code> property name or the string <code>'id'</code>. If a property name is provided, the function
|
|
1484
|
-
will accumulate results based on that property. If no property name is provided, the function will default to
|
|
1485
|
-
accumulating results</p>
|
|
1437
|
+
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
|
|
1486
1438
|
</div>
|
|
1487
1439
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
1488
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
1440
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of values corresponding to the specified property.</p>
|
|
1489
1441
|
|
|
1490
1442
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1491
1443
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#levelIterative">levelIterative</a></p>
|
|
1492
1444
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#levelIterative">levelIterative</a></p>
|
|
1493
1445
|
<ul>
|
|
1494
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1446
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1134">src/data-structures/binary-tree/abstract-binary-tree.ts:1134</a></li></ul></aside></li>
|
|
1495
1447
|
<li class="tsd-signature tsd-anchor-link" id="levelIterative.levelIterative-3"><span class="tsd-kind-call-signature">level<wbr/>Iterative</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"val"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span><a href="#levelIterative.levelIterative-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
1496
1448
|
<li class="tsd-description">
|
|
1497
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
1498
|
-
in an array, based on a specified property name.</p>
|
|
1449
|
+
<div class="tsd-comment tsd-typography"><p>Performs a level-order traversal on a binary tree starting from the specified node and accumulates the 'val' property of each node.</p>
|
|
1499
1450
|
</div>
|
|
1500
1451
|
<div class="tsd-parameters">
|
|
1501
1452
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
1502
1453
|
<ul class="tsd-parameter-list">
|
|
1503
1454
|
<li>
|
|
1504
1455
|
<h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
|
|
1505
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
1506
|
-
node for the level order traversal. It can be null if no specific node is provided, in which case the root node of
|
|
1507
|
-
the tree is used as the starting node.</p>
|
|
1456
|
+
<div class="tsd-comment tsd-typography"><p>The starting node for the level order traversal. If null, the root node of the tree is used as the starting node.</p>
|
|
1508
1457
|
</div>
|
|
1509
1458
|
<div class="tsd-comment tsd-typography"></div></li>
|
|
1510
1459
|
<li>
|
|
1511
1460
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"val"</span></h5>
|
|
1512
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
1513
|
-
can be either a <code>BinaryTreeNode</code> property name or the string <code>'id'</code>. If a property name is provided, the function
|
|
1514
|
-
will accumulate results based on that property. If no property name is provided, the function will default to
|
|
1515
|
-
accumulating results</p>
|
|
1461
|
+
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
|
|
1516
1462
|
</div>
|
|
1517
1463
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
1518
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"val"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
1464
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"val"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of 'val' properties from each node.</p>
|
|
1519
1465
|
|
|
1520
1466
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1521
1467
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#levelIterative">levelIterative</a></p>
|
|
1522
1468
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#levelIterative">levelIterative</a></p>
|
|
1523
1469
|
<ul>
|
|
1524
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1470
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1142">src/data-structures/binary-tree/abstract-binary-tree.ts:1142</a></li></ul></aside></li>
|
|
1525
1471
|
<li class="tsd-signature tsd-anchor-link" id="levelIterative.levelIterative-4"><span class="tsd-kind-call-signature">level<wbr/>Iterative</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><a href="#levelIterative.levelIterative-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
1526
1472
|
<li class="tsd-description">
|
|
1527
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
1528
|
-
in an array, based on a specified property name.</p>
|
|
1473
|
+
<div class="tsd-comment tsd-typography"><p>Performs a level-order traversal on a binary tree starting from the specified node and accumulates nodes themselves.</p>
|
|
1529
1474
|
</div>
|
|
1530
1475
|
<div class="tsd-parameters">
|
|
1531
1476
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
1532
1477
|
<ul class="tsd-parameter-list">
|
|
1533
1478
|
<li>
|
|
1534
1479
|
<h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
|
|
1535
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
1536
|
-
node for the level order traversal. It can be null if no specific node is provided, in which case the root node of
|
|
1537
|
-
the tree is used as the starting node.</p>
|
|
1480
|
+
<div class="tsd-comment tsd-typography"><p>The starting node for the level order traversal. If null, the root node of the tree is used as the starting node.</p>
|
|
1538
1481
|
</div>
|
|
1539
1482
|
<div class="tsd-comment tsd-typography"></div></li>
|
|
1540
1483
|
<li>
|
|
1541
1484
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"node"</span></h5>
|
|
1542
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
1543
|
-
can be either a <code>BinaryTreeNode</code> property name or the string <code>'id'</code>. If a property name is provided, the function
|
|
1544
|
-
will accumulate results based on that property. If no property name is provided, the function will default to
|
|
1545
|
-
accumulating results</p>
|
|
1485
|
+
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
|
|
1546
1486
|
</div>
|
|
1547
1487
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
1548
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
1488
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree nodes.</p>
|
|
1549
1489
|
|
|
1550
1490
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1551
1491
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#levelIterative">levelIterative</a></p>
|
|
1552
1492
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#levelIterative">levelIterative</a></p>
|
|
1553
1493
|
<ul>
|
|
1554
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1494
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1150">src/data-structures/binary-tree/abstract-binary-tree.ts:1150</a></li></ul></aside></li></ul></section>
|
|
1555
1495
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="listLevels" class="tsd-anchor"></a>
|
|
1556
1496
|
<h3 class="tsd-anchor-link"><span>list<wbr/>Levels</span><a href="#listLevels" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1557
1497
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
1558
1498
|
<li class="tsd-signature tsd-anchor-link" id="listLevels.listLevels-1"><span class="tsd-kind-call-signature">list<wbr/>Levels</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span><a href="#listLevels.listLevels-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
1559
1499
|
<li class="tsd-description">
|
|
1560
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
1500
|
+
<div class="tsd-comment tsd-typography"><p>Collects nodes from a binary tree by a specified property and organizes them into levels.</p>
|
|
1561
1501
|
</div>
|
|
1562
1502
|
<div class="tsd-parameters">
|
|
1563
1503
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
1564
1504
|
<ul class="tsd-parameter-list">
|
|
1565
1505
|
<li>
|
|
1566
1506
|
<h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
|
|
1567
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
1568
|
-
root node of a binary tree. If it is null, the function will use the root node of the current binary tree instance.</p>
|
|
1507
|
+
<div class="tsd-comment tsd-typography"><p>The root node of the binary tree or null. If null, the function will use the root node of the current binary tree instance.</p>
|
|
1569
1508
|
</div>
|
|
1570
1509
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
1571
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
1510
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span></h4><p>A 2D array of AbstractBinaryTreeNodeProperty<N> objects.</p>
|
|
1572
1511
|
|
|
1573
1512
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1574
1513
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#listLevels">listLevels</a></p>
|
|
1575
1514
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#listLevels">listLevels</a></p>
|
|
1576
1515
|
<ul>
|
|
1577
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1516
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1193">src/data-structures/binary-tree/abstract-binary-tree.ts:1193</a></li></ul></aside></li>
|
|
1578
1517
|
<li class="tsd-signature tsd-anchor-link" id="listLevels.listLevels-2"><span class="tsd-kind-call-signature">list<wbr/>Levels</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span><a href="#listLevels.listLevels-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
1579
1518
|
<li class="tsd-description">
|
|
1580
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
1519
|
+
<div class="tsd-comment tsd-typography"><p>Collects nodes from a binary tree by a specified property and organizes them into levels.</p>
|
|
1581
1520
|
</div>
|
|
1582
1521
|
<div class="tsd-parameters">
|
|
1583
1522
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
1584
1523
|
<ul class="tsd-parameter-list">
|
|
1585
1524
|
<li>
|
|
1586
1525
|
<h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
|
|
1587
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
1588
|
-
root node of a binary tree. If it is null, the function will use the root node of the current binary tree instance.</p>
|
|
1526
|
+
<div class="tsd-comment tsd-typography"><p>The root node of the binary tree or null. If null, the function will use the root node of the current binary tree instance.</p>
|
|
1589
1527
|
</div>
|
|
1590
1528
|
<div class="tsd-comment tsd-typography"></div></li>
|
|
1591
1529
|
<li>
|
|
1592
|
-
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"id"</span></h5>
|
|
1593
|
-
<
|
|
1594
|
-
specifies the property of the <code>BinaryTreeNode</code> object to collect at each level. It can be one of the following
|
|
1595
|
-
values:</p>
|
|
1596
|
-
</div>
|
|
1597
|
-
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
1598
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span></h4><p>The function <code>listLevels</code> returns a 2D array of <code>AbstractBinaryTreeNodeProperty<N></code> objects.</p>
|
|
1599
|
-
|
|
1530
|
+
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"id"</span></h5></li></ul></div>
|
|
1531
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span></h4>
|
|
1600
1532
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1601
1533
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#listLevels">listLevels</a></p>
|
|
1602
1534
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#listLevels">listLevels</a></p>
|
|
1603
1535
|
<ul>
|
|
1604
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1536
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1201">src/data-structures/binary-tree/abstract-binary-tree.ts:1201</a></li></ul></aside></li>
|
|
1605
1537
|
<li class="tsd-signature tsd-anchor-link" id="listLevels.listLevels-3"><span class="tsd-kind-call-signature">list<wbr/>Levels</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"val"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span><a href="#listLevels.listLevels-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
1606
1538
|
<li class="tsd-description">
|
|
1607
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
1539
|
+
<div class="tsd-comment tsd-typography"><p>Collects nodes from a binary tree by a specified property and organizes them into levels.</p>
|
|
1608
1540
|
</div>
|
|
1609
1541
|
<div class="tsd-parameters">
|
|
1610
1542
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
1611
1543
|
<ul class="tsd-parameter-list">
|
|
1612
1544
|
<li>
|
|
1613
1545
|
<h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
|
|
1614
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
1615
|
-
root node of a binary tree. If it is null, the function will use the root node of the current binary tree instance.</p>
|
|
1546
|
+
<div class="tsd-comment tsd-typography"><p>The root node of the binary tree or null. If null, the function will use the root node of the current binary tree instance.</p>
|
|
1616
1547
|
</div>
|
|
1617
1548
|
<div class="tsd-comment tsd-typography"></div></li>
|
|
1618
1549
|
<li>
|
|
1619
1550
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"val"</span></h5>
|
|
1620
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
1621
|
-
specifies the property of the <code>BinaryTreeNode</code> object to collect at each level. It can be one of the following
|
|
1622
|
-
values:</p>
|
|
1551
|
+
<div class="tsd-comment tsd-typography"><p>The property of the BinaryTreeNode object to collect at each level.</p>
|
|
1623
1552
|
</div>
|
|
1624
1553
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
1625
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"val"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
1554
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[</span><span class="tsd-signature-type">"val"</span><span class="tsd-signature-symbol">]</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span></h4><p>A 2D array of 'val' properties from each node.</p>
|
|
1626
1555
|
|
|
1627
1556
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1628
1557
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#listLevels">listLevels</a></p>
|
|
1629
1558
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#listLevels">listLevels</a></p>
|
|
1630
1559
|
<ul>
|
|
1631
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1560
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1209">src/data-structures/binary-tree/abstract-binary-tree.ts:1209</a></li></ul></aside></li>
|
|
1632
1561
|
<li class="tsd-signature tsd-anchor-link" id="listLevels.listLevels-4"><span class="tsd-kind-call-signature">list<wbr/>Levels</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">node</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span><a href="#listLevels.listLevels-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
1633
1562
|
<li class="tsd-description">
|
|
1634
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
1563
|
+
<div class="tsd-comment tsd-typography"><p>Collects nodes from a binary tree by a specified property and organizes them into levels.</p>
|
|
1635
1564
|
</div>
|
|
1636
1565
|
<div class="tsd-parameters">
|
|
1637
1566
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
1638
1567
|
<ul class="tsd-parameter-list">
|
|
1639
1568
|
<li>
|
|
1640
1569
|
<h5><span class="tsd-kind-parameter">node</span>: <span class="tsd-signature-type">null</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span></h5>
|
|
1641
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
1642
|
-
root node of a binary tree. If it is null, the function will use the root node of the current binary tree instance.</p>
|
|
1570
|
+
<div class="tsd-comment tsd-typography"><p>The root node of the binary tree or null. If null, the function will use the root node of the current binary tree instance.</p>
|
|
1643
1571
|
</div>
|
|
1644
1572
|
<div class="tsd-comment tsd-typography"></div></li>
|
|
1645
1573
|
<li>
|
|
1646
1574
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"node"</span></h5>
|
|
1647
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
1648
|
-
specifies the property of the <code>BinaryTreeNode</code> object to collect at each level. It can be one of the following
|
|
1649
|
-
values:</p>
|
|
1575
|
+
<div class="tsd-comment tsd-typography"><p>The property of the BinaryTreeNode object to collect at each level.</p>
|
|
1650
1576
|
</div>
|
|
1651
1577
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
1652
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
1578
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">[]</span></h4><p>A 2D array of binary tree nodes.</p>
|
|
1653
1579
|
|
|
1654
1580
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1655
1581
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#listLevels">listLevels</a></p>
|
|
1656
1582
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#listLevels">listLevels</a></p>
|
|
1657
1583
|
<ul>
|
|
1658
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1584
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1217">src/data-structures/binary-tree/abstract-binary-tree.ts:1217</a></li></ul></aside></li></ul></section>
|
|
1659
1585
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="morris" class="tsd-anchor"></a>
|
|
1660
1586
|
<h3 class="tsd-anchor-link"><span>morris</span><a href="#morris" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1661
1587
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
1662
1588
|
<li class="tsd-signature tsd-anchor-link" id="morris.morris-1"><span class="tsd-kind-call-signature">morris</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#morris.morris-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
1663
1589
|
<li class="tsd-description">
|
|
1664
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
1665
|
-
traversal algorithm.</p>
|
|
1590
|
+
<div class="tsd-comment tsd-typography"><p>Performs an in-order, pre-order, or post-order traversal on a binary tree using the Morris traversal algorithm.</p>
|
|
1666
1591
|
</div>
|
|
1667
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
1592
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree node IDs.</p>
|
|
1668
1593
|
|
|
1669
1594
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1670
1595
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#morris">morris</a></p>
|
|
1671
1596
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#morris">morris</a></p>
|
|
1672
1597
|
<ul>
|
|
1673
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1598
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1303">src/data-structures/binary-tree/abstract-binary-tree.ts:1303</a></li></ul></aside></li>
|
|
1674
1599
|
<li class="tsd-signature tsd-anchor-link" id="morris.morris-2"><span class="tsd-kind-call-signature">morris</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pattern</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span><a href="#morris.morris-2" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
1675
1600
|
<li class="tsd-description">
|
|
1676
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
1677
|
-
traversal algorithm.</p>
|
|
1601
|
+
<div class="tsd-comment tsd-typography"><p>Performs an in-order, pre-order, or post-order traversal on a binary tree using the Morris traversal algorithm and accumulates properties of each node based on the specified property name.</p>
|
|
1678
1602
|
</div>
|
|
1679
1603
|
<div class="tsd-parameters">
|
|
1680
1604
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
1681
1605
|
<ul class="tsd-parameter-list">
|
|
1682
1606
|
<li>
|
|
1683
1607
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5>
|
|
1684
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
1685
|
-
tree. It can have one of three values:</p>
|
|
1608
|
+
<div class="tsd-comment tsd-typography"><p>The traversal pattern: 'in' (in-order), 'pre' (pre-order), or 'post' (post-order).</p>
|
|
1686
1609
|
</div>
|
|
1687
1610
|
<div class="tsd-comment tsd-typography"></div></li>
|
|
1688
1611
|
<li>
|
|
1689
1612
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"id"</span></h5>
|
|
1690
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
1691
|
-
property name of the nodes that you want to retrieve. It can be any valid property name of the nodes in the binary
|
|
1692
|
-
tree.</p>
|
|
1613
|
+
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
|
|
1693
1614
|
</div>
|
|
1694
1615
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
1695
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
1616
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of values corresponding to the specified property.</p>
|
|
1696
1617
|
|
|
1697
1618
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1698
1619
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#morris">morris</a></p>
|
|
1699
1620
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#morris">morris</a></p>
|
|
1700
1621
|
<ul>
|
|
1701
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1622
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1311">src/data-structures/binary-tree/abstract-binary-tree.ts:1311</a></li></ul></aside></li>
|
|
1702
1623
|
<li class="tsd-signature tsd-anchor-link" id="morris.morris-3"><span class="tsd-kind-call-signature">morris</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pattern</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><a href="#morris.morris-3" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
1703
1624
|
<li class="tsd-description">
|
|
1704
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
1705
|
-
traversal algorithm.</p>
|
|
1625
|
+
<div class="tsd-comment tsd-typography"><p>Performs an in-order, pre-order, or post-order traversal on a binary tree using the Morris traversal algorithm and accumulates the 'val' property of each node.</p>
|
|
1706
1626
|
</div>
|
|
1707
1627
|
<div class="tsd-parameters">
|
|
1708
1628
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
1709
1629
|
<ul class="tsd-parameter-list">
|
|
1710
1630
|
<li>
|
|
1711
1631
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5>
|
|
1712
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
1713
|
-
tree. It can have one of three values:</p>
|
|
1632
|
+
<div class="tsd-comment tsd-typography"><p>The traversal pattern: 'in' (in-order), 'pre' (pre-order), or 'post' (post-order).</p>
|
|
1714
1633
|
</div>
|
|
1715
1634
|
<div class="tsd-comment tsd-typography"></div></li>
|
|
1716
1635
|
<li>
|
|
1717
1636
|
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"val"</span></h5>
|
|
1718
|
-
<div class="tsd-comment tsd-typography"><p>The
|
|
1719
|
-
property name of the nodes that you want to retrieve. It can be any valid property name of the nodes in the binary
|
|
1720
|
-
tree.</p>
|
|
1637
|
+
<div class="tsd-comment tsd-typography"><p>The property of the BinaryTreeNode object to collect at each level.</p>
|
|
1721
1638
|
</div>
|
|
1722
1639
|
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
1723
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>
|
|
1640
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of 'val' properties from each node.</p>
|
|
1724
1641
|
|
|
1725
1642
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1726
1643
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#morris">morris</a></p>
|
|
1727
1644
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#morris">morris</a></p>
|
|
1728
1645
|
<ul>
|
|
1729
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1646
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1319">src/data-structures/binary-tree/abstract-binary-tree.ts:1319</a></li></ul></aside></li>
|
|
1730
1647
|
<li class="tsd-signature tsd-anchor-link" id="morris.morris-4"><span class="tsd-kind-call-signature">morris</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">pattern</span><span class="tsd-signature-symbol">?</span>, <span class="tsd-kind-parameter">nodeOrPropertyName</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span><a href="#morris.morris-4" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
|
|
1731
1648
|
<li class="tsd-description">
|
|
1732
|
-
<div class="tsd-comment tsd-typography"><p>
|
|
1733
|
-
Space complexity of Iterative DFS equals to recursive DFS which is O(n) because of the stack</p>
|
|
1649
|
+
<div class="tsd-comment tsd-typography"><p>Performs an in-order, pre-order, or post-order traversal on a binary tree using the Morris traversal algorithm and accumulates nodes themselves.</p>
|
|
1734
1650
|
</div>
|
|
1735
1651
|
<div class="tsd-parameters">
|
|
1736
1652
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
1737
1653
|
<ul class="tsd-parameter-list">
|
|
1738
1654
|
<li>
|
|
1739
|
-
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5
|
|
1655
|
+
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <a href="../types/DFSOrderPattern.html" class="tsd-signature-type tsd-kind-type-alias">DFSOrderPattern</a></h5>
|
|
1656
|
+
<div class="tsd-comment tsd-typography"><p>The traversal pattern: 'in' (in-order), 'pre' (pre-order), or 'post' (post-order).</p>
|
|
1657
|
+
</div>
|
|
1658
|
+
<div class="tsd-comment tsd-typography"></div></li>
|
|
1740
1659
|
<li>
|
|
1741
|
-
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"node"</span></h5
|
|
1742
|
-
<
|
|
1660
|
+
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"node"</span></h5>
|
|
1661
|
+
<div class="tsd-comment tsd-typography"><p>The property of the BinaryTreeNode object to collect at each level.</p>
|
|
1662
|
+
</div>
|
|
1663
|
+
<div class="tsd-comment tsd-typography"></div></li></ul></div>
|
|
1664
|
+
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><p>An array of binary tree nodes.</p>
|
|
1665
|
+
|
|
1743
1666
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1744
1667
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#morris">morris</a></p>
|
|
1745
1668
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#morris">morris</a></p>
|
|
1746
1669
|
<ul>
|
|
1747
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1670
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L1327">src/data-structures/binary-tree/abstract-binary-tree.ts:1327</a></li></ul></aside></li></ul></section>
|
|
1748
1671
|
<section class="tsd-panel tsd-member"><a id="perfectlyBalance" class="tsd-anchor"></a>
|
|
1749
1672
|
<h3 class="tsd-anchor-link"><span>perfectly<wbr/>Balance</span><a href="#perfectlyBalance" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1750
1673
|
<ul class="tsd-signatures">
|
|
@@ -1758,7 +1681,7 @@ constructs a balanced binary search tree using either a recursive or iterative a
|
|
|
1758
1681
|
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
|
|
1759
1682
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#perfectlyBalance">perfectlyBalance</a></p>
|
|
1760
1683
|
<ul>
|
|
1761
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1684
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/bst.ts#L440">src/data-structures/binary-tree/bst.ts:440</a></li></ul></aside></li></ul></section>
|
|
1762
1685
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="remove" class="tsd-anchor"></a>
|
|
1763
1686
|
<h3 class="tsd-anchor-link"><span>remove</span><a href="#remove" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1764
1687
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -1789,7 +1712,7 @@ determines whether to update the left sum of all nodes in the binary tree after
|
|
|
1789
1712
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#remove">remove</a></p>
|
|
1790
1713
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#remove">remove</a></p>
|
|
1791
1714
|
<ul>
|
|
1792
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1715
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L356">src/data-structures/binary-tree/abstract-binary-tree.ts:356</a></li></ul></aside></li></ul></section>
|
|
1793
1716
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="subTreeAdd" class="tsd-anchor"></a>
|
|
1794
1717
|
<h3 class="tsd-anchor-link"><span>sub<wbr/>Tree<wbr/>Add</span><a href="#subTreeAdd" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1795
1718
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -1824,7 +1747,7 @@ specifies the property of the binary tree node that should be modified. If not p
|
|
|
1824
1747
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#subTreeAdd">subTreeAdd</a></p>
|
|
1825
1748
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#subTreeAdd">subTreeAdd</a></p>
|
|
1826
1749
|
<ul>
|
|
1827
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1750
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L878">src/data-structures/binary-tree/abstract-binary-tree.ts:878</a></li></ul></aside></li></ul></section>
|
|
1828
1751
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="subTreeSum" class="tsd-anchor"></a>
|
|
1829
1752
|
<h3 class="tsd-anchor-link"><span>sub<wbr/>Tree<wbr/>Sum</span><a href="#subTreeSum" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1830
1753
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -1854,7 +1777,7 @@ not provided, it defaults to 'id'.</p>
|
|
|
1854
1777
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#subTreeSum">subTreeSum</a></p>
|
|
1855
1778
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#subTreeSum">subTreeSum</a></p>
|
|
1856
1779
|
<ul>
|
|
1857
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1780
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L822">src/data-structures/binary-tree/abstract-binary-tree.ts:822</a></li></ul></aside></li></ul></section>
|
|
1858
1781
|
<section class="tsd-panel tsd-member tsd-is-inherited"><a id="swapLocation" class="tsd-anchor"></a>
|
|
1859
1782
|
<h3 class="tsd-anchor-link"><span>swap<wbr/>Location</span><a href="#swapLocation" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
|
|
1860
1783
|
<ul class="tsd-signatures tsd-is-inherited">
|
|
@@ -1882,7 +1805,7 @@ be swapped to.</p>
|
|
|
1882
1805
|
<p>Implementation of <a href="../interfaces/IBST.html">IBST</a>.<a href="../interfaces/IBST.html#swapLocation">swapLocation</a></p>
|
|
1883
1806
|
<p>Inherited from <a href="BinaryTree.html">BinaryTree</a>.<a href="BinaryTree.html#swapLocation">swapLocation</a></p>
|
|
1884
1807
|
<ul>
|
|
1885
|
-
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/
|
|
1808
|
+
<li>Defined in <a href="https://github.com/zrwusa/data-structure-typed/blob/6996813/src/data-structures/binary-tree/abstract-binary-tree.ts#L201">src/data-structures/binary-tree/abstract-binary-tree.ts:201</a></li></ul></aside></li></ul></section></section></div>
|
|
1886
1809
|
<div class="col-sidebar">
|
|
1887
1810
|
<div class="page-menu">
|
|
1888
1811
|
<div class="tsd-navigation settings">
|