binary-tree-typed
Version:
Binary Tree. Javascript & Typescript Data Structure.
430 lines (419 loc) • 201 kB
HTML
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>BinaryTree | binary-tree-typed</title><meta name="description" content="Documentation for binary-tree-typed"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
<div class="tsd-toolbar-contents container">
<div class="table-cell" id="tsd-search" data-base="..">
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
<div class="field">
<div id="tsd-toolbar-links"></div></div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">binary-tree-typed</a></div>
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="#icon-menu"></use></svg></a></div></div></header>
<div class="container container-main">
<div class="col-content">
<div class="tsd-page-title">
<ul class="tsd-breadcrumb">
<li><a href="../modules.html">binary-tree-typed</a></li>
<li><a href="BinaryTree.html">BinaryTree</a></li></ul>
<h1>Class BinaryTree<N></h1></div>
<section class="tsd-panel">
<h4>Type Parameters</h4>
<ul class="tsd-type-parameter-list">
<li>
<h4><span class="tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol"> extends </span><a href="BinaryTreeNode.html" class="tsd-signature-type tsd-kind-class">BinaryTreeNode</a><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-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">></span> = <a href="BinaryTreeNode.html" class="tsd-signature-type tsd-kind-class">BinaryTreeNode</a></h4></li></ul></section>
<section class="tsd-panel tsd-hierarchy">
<h4>Hierarchy</h4>
<ul class="tsd-hierarchy">
<li><span class="tsd-signature-type ">AbstractBinaryTree</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">></span>
<ul class="tsd-hierarchy">
<li><span class="target">BinaryTree</span></li></ul></li></ul></section>
<section class="tsd-panel">
<h4>Implements</h4>
<ul class="tsd-hierarchy">
<li><span class="tsd-signature-type ">IBinaryTree</span><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">
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/binary-tree.d.ts:14</li></ul></aside>
<section class="tsd-panel-group tsd-index-group">
<section class="tsd-panel tsd-index-panel">
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
<h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex=0><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="#icon-chevronSmall"></use></svg> Index</h5></summary>
<div class="tsd-accordion-details">
<section class="tsd-index-section">
<h3 class="tsd-index-heading">Constructors</h3>
<div class="tsd-index-list"><a href="BinaryTree.html#constructor" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-512"></use></svg><span>constructor</span></a>
</div></section>
<section class="tsd-index-section">
<h3 class="tsd-index-heading">Accessors</h3>
<div class="tsd-index-list"><a href="BinaryTree.html#loopType" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-262144"></use></svg><span>loop<wbr/>Type</span></a>
<a href="BinaryTree.html#root" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-262144"></use></svg><span>root</span></a>
<a href="BinaryTree.html#size" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-262144"></use></svg><span>size</span></a>
<a href="BinaryTree.html#visitedId" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-262144"></use></svg><span>visited<wbr/>Id</span></a>
<a href="BinaryTree.html#visitedLeftSum" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-262144"></use></svg><span>visited<wbr/>Left<wbr/>Sum</span></a>
<a href="BinaryTree.html#visitedNode" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-262144"></use></svg><span>visited<wbr/>Node</span></a>
<a href="BinaryTree.html#visitedVal" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-262144"></use></svg><span>visited<wbr/>Val</span></a>
</div></section>
<section class="tsd-index-section">
<h3 class="tsd-index-heading">Methods</h3>
<div class="tsd-index-list"><a href="BinaryTree.html#BFS" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>BFS</span></a>
<a href="BinaryTree.html#DFS" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>DFS</span></a>
<a href="BinaryTree.html#DFSIterative" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>DFSIterative</span></a>
<a href="BinaryTree.html#_accumulatedByPropertyName" class="tsd-index-link tsd-is-protected tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>_accumulated<wbr/>By<wbr/>Property<wbr/>Name</span></a>
<a href="BinaryTree.html#_addTo" class="tsd-index-link tsd-is-protected tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>_add<wbr/>To</span></a>
<a href="BinaryTree.html#_clearResults" class="tsd-index-link tsd-is-protected tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>_clear<wbr/>Results</span></a>
<a href="BinaryTree.html#_getResultByPropertyName" class="tsd-index-link tsd-is-protected tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>_get<wbr/>Result<wbr/>By<wbr/>Property<wbr/>Name</span></a>
<a href="BinaryTree.html#_pushByPropertyNameStopOrNot" class="tsd-index-link tsd-is-protected tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>_push<wbr/>By<wbr/>Property<wbr/>Name<wbr/>Stop<wbr/>Or<wbr/>Not</span></a>
<a href="BinaryTree.html#_setLoopType" class="tsd-index-link tsd-is-protected tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>_set<wbr/>Loop<wbr/>Type</span></a>
<a href="BinaryTree.html#_setRoot" class="tsd-index-link tsd-is-protected tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>_set<wbr/>Root</span></a>
<a href="BinaryTree.html#_setSize" class="tsd-index-link tsd-is-protected tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>_set<wbr/>Size</span></a>
<a href="BinaryTree.html#_setVisitedId" class="tsd-index-link tsd-is-protected tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>_set<wbr/>Visited<wbr/>Id</span></a>
<a href="BinaryTree.html#_setVisitedLeftSum" class="tsd-index-link tsd-is-protected tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>_set<wbr/>Visited<wbr/>Left<wbr/>Sum</span></a>
<a href="BinaryTree.html#_setVisitedNode" class="tsd-index-link tsd-is-protected tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>_set<wbr/>Visited<wbr/>Node</span></a>
<a href="BinaryTree.html#_setVisitedVal" class="tsd-index-link tsd-is-protected tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>_set<wbr/>Visited<wbr/>Val</span></a>
<a href="BinaryTree.html#add" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>add</span></a>
<a href="BinaryTree.html#addMany" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>add<wbr/>Many</span></a>
<a href="BinaryTree.html#clear" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>clear</span></a>
<a href="BinaryTree.html#createNode" class="tsd-index-link tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>create<wbr/>Node</span></a>
<a href="BinaryTree.html#fill" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>fill</span></a>
<a href="BinaryTree.html#get" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get</span></a>
<a href="BinaryTree.html#getDepth" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Depth</span></a>
<a href="BinaryTree.html#getHeight" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Height</span></a>
<a href="BinaryTree.html#getLeftMost" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Left<wbr/>Most</span></a>
<a href="BinaryTree.html#getMinHeight" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Min<wbr/>Height</span></a>
<a href="BinaryTree.html#getNodes" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Nodes</span></a>
<a href="BinaryTree.html#getPathToRoot" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Path<wbr/>To<wbr/>Root</span></a>
<a href="BinaryTree.html#getPredecessor" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Predecessor</span></a>
<a href="BinaryTree.html#getRightMost" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Right<wbr/>Most</span></a>
<a href="BinaryTree.html#getSubTreeSize" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>get<wbr/>Sub<wbr/>Tree<wbr/>Size</span></a>
<a href="BinaryTree.html#has" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>has</span></a>
<a href="BinaryTree.html#isBST" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>isBST</span></a>
<a href="BinaryTree.html#isEmpty" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>is<wbr/>Empty</span></a>
<a href="BinaryTree.html#isPerfectlyBalanced" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>is<wbr/>Perfectly<wbr/>Balanced</span></a>
<a href="BinaryTree.html#isSubtreeBST" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>is<wbr/>SubtreeBST</span></a>
<a href="BinaryTree.html#levelIterative" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>level<wbr/>Iterative</span></a>
<a href="BinaryTree.html#listLevels" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>list<wbr/>Levels</span></a>
<a href="BinaryTree.html#morris" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>morris</span></a>
<a href="BinaryTree.html#remove" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>remove</span></a>
<a href="BinaryTree.html#subTreeAdd" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>sub<wbr/>Tree<wbr/>Add</span></a>
<a href="BinaryTree.html#subTreeSum" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>sub<wbr/>Tree<wbr/>Sum</span></a>
<a href="BinaryTree.html#swapLocation" class="tsd-index-link tsd-is-inherited tsd-is-external"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="#icon-2048"></use></svg><span>swap<wbr/>Location</span></a>
</div></section></div></details></section></section>
<section class="tsd-panel-group tsd-member-group">
<h2>Constructors</h2>
<section class="tsd-panel tsd-member tsd-is-external"><a id="constructor" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<ul class="tsd-signatures tsd-is-external">
<li class="tsd-signature tsd-anchor-link" id="constructor.new_BinaryTree"><span class="tsd-kind-constructor-signature">new <wbr/>Binary<wbr/>Tree</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><span class="tsd-kind-parameter">options</span><span class="tsd-signature-symbol">?</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="BinaryTree.html" class="tsd-signature-type tsd-kind-class">BinaryTree</a><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="#constructor.new_BinaryTree" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></li>
<li class="tsd-description">
<div class="tsd-comment tsd-typography"><p>This is a constructor function for a binary tree class that takes an optional options parameter.</p>
</div>
<section class="tsd-panel">
<h4>Type Parameters</h4>
<ul class="tsd-type-parameter-list">
<li>
<h4><span class="tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol"> extends </span><a href="BinaryTreeNode.html" class="tsd-signature-type tsd-kind-class">BinaryTreeNode</a><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-type tsd-kind-type-parameter">N</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="BinaryTreeNode.html" class="tsd-signature-type tsd-kind-class">BinaryTreeNode</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type ">BinaryTreeNodeNested</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">></span></h4></li></ul></section>
<div class="tsd-parameters">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">options</span>: <span class="tsd-signature-type ">AbstractBinaryTreeOptions</span></h5>
<div class="tsd-comment tsd-typography"><p>The <code>options</code> parameter is an optional object that can be passed to the
constructor of the <code>BinaryTree</code> class. It allows you to customize the behavior of the binary tree by providing
different configuration options.</p>
</div>
<div class="tsd-comment tsd-typography"></div></li></ul></div>
<h4 class="tsd-returns-title">Returns <a href="BinaryTree.html" class="tsd-signature-type tsd-kind-class">BinaryTree</a><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">></span></h4>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<p>Overrides AbstractBinaryTree<N>.constructor</p>
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/binary-tree.d.ts:21</li></ul></aside></li></ul></section></section>
<section class="tsd-panel-group tsd-member-group">
<h2>Accessors</h2>
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="loopType" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>loop<wbr/>Type</span><a href="#loopType" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
<li class="tsd-signature" id="loopType.loopType-1"><span class="tsd-signature-symbol">get</span> loopType<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type ">LoopType</span></li>
<li class="tsd-description">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type ">LoopType</span></h4><aside class="tsd-sources">
<p>Implementation of IBinaryTree.loopType</p>
<p>Inherited from AbstractBinaryTree.loopType</p>
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/abstract-binary-tree.d.ts:56</li></ul></aside></li></ul></section>
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="root" class="tsd-anchor"></a>
<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>
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
<li class="tsd-signature" id="root.root-1"><span class="tsd-signature-symbol">get</span> root<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></li>
<li class="tsd-description">
<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><aside class="tsd-sources">
<p>Implementation of IBinaryTree.root</p>
<p>Inherited from AbstractBinaryTree.root</p>
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/abstract-binary-tree.d.ts:52</li></ul></aside></li></ul></section>
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="size" class="tsd-anchor"></a>
<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>
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
<li class="tsd-signature" id="size.size-1"><span class="tsd-signature-symbol">get</span> size<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></li>
<li class="tsd-description">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span></h4><aside class="tsd-sources">
<p>Implementation of IBinaryTree.size</p>
<p>Inherited from AbstractBinaryTree.size</p>
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/abstract-binary-tree.d.ts:54</li></ul></aside></li></ul></section>
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="visitedId" class="tsd-anchor"></a>
<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>
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
<li class="tsd-signature" id="visitedId.visitedId-1"><span class="tsd-signature-symbol">get</span> visitedId<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></li>
<li class="tsd-description">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
<p>Implementation of IBinaryTree.visitedId</p>
<p>Inherited from AbstractBinaryTree.visitedId</p>
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/abstract-binary-tree.d.ts:58</li></ul></aside></li></ul></section>
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="visitedLeftSum" class="tsd-anchor"></a>
<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>
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
<li class="tsd-signature" id="visitedLeftSum.visitedLeftSum-1"><span class="tsd-signature-symbol">get</span> visitedLeftSum<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></li>
<li class="tsd-description">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
<p>Implementation of IBinaryTree.visitedLeftSum</p>
<p>Inherited from AbstractBinaryTree.visitedLeftSum</p>
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/abstract-binary-tree.d.ts:64</li></ul></aside></li></ul></section>
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="visitedNode" class="tsd-anchor"></a>
<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>
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
<li class="tsd-signature" id="visitedNode.visitedNode-1"><span class="tsd-signature-symbol">get</span> visitedNode<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></li>
<li class="tsd-description">
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type tsd-kind-type-parameter">N</span><span class="tsd-signature-symbol">[]</span></h4><aside class="tsd-sources">
<p>Implementation of IBinaryTree.visitedNode</p>
<p>Inherited from AbstractBinaryTree.visitedNode</p>
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/abstract-binary-tree.d.ts:62</li></ul></aside></li></ul></section>
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="visitedVal" class="tsd-anchor"></a>
<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>
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
<li class="tsd-signature" id="visitedVal.visitedVal-1"><span class="tsd-signature-symbol">get</span> visitedVal<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></li>
<li class="tsd-description">
<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><aside class="tsd-sources">
<p>Implementation of IBinaryTree.visitedVal</p>
<p>Inherited from AbstractBinaryTree.visitedVal</p>
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/abstract-binary-tree.d.ts:60</li></ul></aside></li></ul></section></section>
<section class="tsd-panel-group tsd-member-group">
<h2>Methods</h2>
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="BFS" class="tsd-anchor"></a>
<h3 class="tsd-anchor-link"><span>BFS</span><a href="#BFS" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="#icon-anchor"></use></svg></a></h3>
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
<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>
<li class="tsd-description">
<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>
</div>
<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>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<p>Implementation of IBinaryTree.BFS</p>
<p>Inherited from AbstractBinaryTree.BFS</p>
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/abstract-binary-tree.d.ts:287</li></ul></aside></li>
<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>
<li class="tsd-description">
<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>
</div>
<div class="tsd-parameters">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5><span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"id"</span></h5>
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
</div>
<div class="tsd-comment tsd-typography"></div></li></ul></div>
<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>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<p>Implementation of IBinaryTree.BFS</p>
<p>Inherited from AbstractBinaryTree.BFS</p>
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/abstract-binary-tree.d.ts:293</li></ul></aside></li>
<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>
<li class="tsd-description">
<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>
</div>
<div class="tsd-parameters">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5><span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"val"</span></h5>
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
</div>
<div class="tsd-comment tsd-typography"></div></li></ul></div>
<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>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<p>Implementation of IBinaryTree.BFS</p>
<p>Inherited from AbstractBinaryTree.BFS</p>
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/abstract-binary-tree.d.ts:299</li></ul></aside></li>
<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>
<li class="tsd-description">
<div class="tsd-comment tsd-typography"><p>Performs a breadth-first search (BFS) on a binary tree, accumulating nodes themselves.</p>
</div>
<div class="tsd-parameters">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5><span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"node"</span></h5>
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
</div>
<div class="tsd-comment tsd-typography"></div></li></ul></div>
<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>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<p>Implementation of IBinaryTree.BFS</p>
<p>Inherited from AbstractBinaryTree.BFS</p>
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/abstract-binary-tree.d.ts:305</li></ul></aside></li></ul></section>
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="DFS" class="tsd-anchor"></a>
<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>
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
<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>
<li class="tsd-description">
<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>
</div>
<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>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<p>Implementation of IBinaryTree.DFS</p>
<p>Inherited from AbstractBinaryTree.DFS</p>
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/abstract-binary-tree.d.ts:310</li></ul></aside></li>
<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>
<li class="tsd-description">
<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>
</div>
<div class="tsd-parameters">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <span class="tsd-signature-type ">DFSOrderPattern</span></h5>
<div class="tsd-comment tsd-typography"><p>The traversal pattern: 'in' (in-order), 'pre' (pre-order), or 'post' (post-order).</p>
</div>
<div class="tsd-comment tsd-typography"></div></li>
<li>
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"id"</span></h5>
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
</div>
<div class="tsd-comment tsd-typography"></div></li></ul></div>
<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>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<p>Implementation of IBinaryTree.DFS</p>
<p>Inherited from AbstractBinaryTree.DFS</p>
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/abstract-binary-tree.d.ts:317</li></ul></aside></li>
<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>
<li class="tsd-description">
<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>
</div>
<div class="tsd-parameters">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <span class="tsd-signature-type ">DFSOrderPattern</span></h5>
<div class="tsd-comment tsd-typography"><p>The traversal pattern: 'in' (in-order), 'pre' (pre-order), or 'post' (post-order).</p>
</div>
<div class="tsd-comment tsd-typography"></div></li>
<li>
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"val"</span></h5>
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
</div>
<div class="tsd-comment tsd-typography"></div></li></ul></div>
<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>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<p>Implementation of IBinaryTree.DFS</p>
<p>Inherited from AbstractBinaryTree.DFS</p>
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/abstract-binary-tree.d.ts:324</li></ul></aside></li>
<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>
<li class="tsd-description">
<div class="tsd-comment tsd-typography"><p>Performs a depth-first search (DFS) traversal on a binary tree and accumulates nodes themselves.</p>
</div>
<div class="tsd-parameters">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <span class="tsd-signature-type ">DFSOrderPattern</span></h5>
<div class="tsd-comment tsd-typography"><p>The traversal pattern: 'in' (in-order), 'pre' (pre-order), or 'post' (post-order).</p>
</div>
<div class="tsd-comment tsd-typography"></div></li>
<li>
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"node"</span></h5>
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
</div>
<div class="tsd-comment tsd-typography"></div></li></ul></div>
<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>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<p>Implementation of IBinaryTree.DFS</p>
<p>Inherited from AbstractBinaryTree.DFS</p>
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/abstract-binary-tree.d.ts:331</li></ul></aside></li></ul></section>
<section class="tsd-panel tsd-member tsd-is-inherited tsd-is-external"><a id="DFSIterative" class="tsd-anchor"></a>
<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>
<ul class="tsd-signatures tsd-is-inherited tsd-is-external">
<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>
<li class="tsd-description">
<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>
</div>
<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>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<p>Implementation of IBinaryTree.DFSIterative</p>
<p>Inherited from AbstractBinaryTree.DFSIterative</p>
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/abstract-binary-tree.d.ts:336</li></ul></aside></li>
<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>
<li class="tsd-description">
<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>
</div>
<div class="tsd-parameters">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <span class="tsd-signature-type ">DFSOrderPattern</span></h5>
<div class="tsd-comment tsd-typography"><p>The traversal pattern: 'in' (in-order), 'pre' (pre-order), or 'post' (post-order).</p>
</div>
<div class="tsd-comment tsd-typography"></div></li>
<li>
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"id"</span></h5>
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
</div>
<div class="tsd-comment tsd-typography"></div></li></ul></div>
<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>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<p>Implementation of IBinaryTree.DFSIterative</p>
<p>Inherited from AbstractBinaryTree.DFSIterative</p>
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/abstract-binary-tree.d.ts:343</li></ul></aside></li>
<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>
<li class="tsd-description">
<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>
</div>
<div class="tsd-parameters">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <span class="tsd-signature-type ">DFSOrderPattern</span></h5>
<div class="tsd-comment tsd-typography"><p>The traversal pattern: 'in' (in-order), 'pre' (pre-order), or 'post' (post-order).</p>
</div>
<div class="tsd-comment tsd-typography"></div></li>
<li>
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">nodeOrPropertyName</span>: <span class="tsd-signature-type">"val"</span></h5>
<div class="tsd-comment tsd-typography"><p>The name of the property to accumulate.</p>
</div>
<div class="tsd-comment tsd-typography"></div></li></ul></div>
<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>
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources">
<p>Implementation of IBinaryTree.DFSIterative</p>
<p>Inherited from AbstractBinaryTree.DFSIterative</p>
<ul>
<li>Defined in node_modules/data-structure-typed/lib/data-structures/binary-tree/abstract-binary-tree.d.ts:350</li></ul></aside></li>
<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>
<li class="tsd-description">
<div class="tsd-comment tsd-typography"><p>Performs an iterative depth-first search (DFS) traversal on a binary tree and accumulates nodes themselves.</p>
</div>
<div class="tsd-parameters">
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameter-list">
<li>
<h5><code class="tsd-tag ts-flagOptional">Optional</code> <span class="tsd-kind-parameter">pattern</span>: <span class="tsd-signature-type ">DFSOrderPattern</span></h5>
<div class="tsd-comment tsd