You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!-- saved from url=(0026)http://www.naturaldocs.org -->
8
+
9
+
10
+
11
+
12
+
<divid=Content><divclass="CFile"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="bst.js"></a>bst.js</h1><divclass=CBody><p>A pure JavaScript implementation of a binary search tree.</p><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#bst.js" >bst.js</a></td><tdclass=SDescription>A pure JavaScript implementation of a binary search tree.</td></tr><trclass="SClass"><tdclass=SEntry><ahref="#BST" >BST</a></td><tdclass=SDescription>The binary search tree class.</td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#BST.Functions" >Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#BST.search" id=link1onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">search</a></td><tdclass=SDescription>Search through a binary tree.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#BST.insert" id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">insert</a></td><tdclass=SDescription>Insert into a binary tree.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#BST.traverse" id=link3onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">traverse</a></td><tdclass=SDescription>Call a function on each node of a binary tree.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#BST.min" id=link4onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">min</a></td><tdclass=SDescription>Find the key of the node with the lowest key number.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#BST.max" id=link5onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">max</a></td><tdclass=SDescription>Find the key of the node with the highest key number.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#BST.successor" id=link6onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">successor</a></td><tdclass=SDescription>Find the key that successes the root node.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#BST.predecessor" id=link7onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">predecessor</a></td><tdclass=SDescription>Find the key that preceeds the root node.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#BST.root" id=link8onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">root</a></td><tdclass=SDescription>The key of the root node.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
13
+
14
+
<divclass="CClass"><divclass=CTopic><h2class=CTitle><aname="BST"></a>BST</h2><divclass=CBody><p>The binary search tree class.</p><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SGroup"><tdclass=SEntry><ahref="#BST.Functions" >Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent1 SMarked"><tdclass=SEntry><ahref="#BST.search" id=link9onMouseOver="ShowTip(event, 'tt1', 'link9')" onMouseOut="HideTip('tt1')">search</a></td><tdclass=SDescription>Search through a binary tree.</td></tr><trclass="SFunction SIndent1"><tdclass=SEntry><ahref="#BST.insert" id=link10onMouseOver="ShowTip(event, 'tt2', 'link10')" onMouseOut="HideTip('tt2')">insert</a></td><tdclass=SDescription>Insert into a binary tree.</td></tr><trclass="SFunction SIndent1 SMarked"><tdclass=SEntry><ahref="#BST.traverse" id=link11onMouseOver="ShowTip(event, 'tt3', 'link11')" onMouseOut="HideTip('tt3')">traverse</a></td><tdclass=SDescription>Call a function on each node of a binary tree.</td></tr><trclass="SFunction SIndent1"><tdclass=SEntry><ahref="#BST.min" id=link12onMouseOver="ShowTip(event, 'tt4', 'link12')" onMouseOut="HideTip('tt4')">min</a></td><tdclass=SDescription>Find the key of the node with the lowest key number.</td></tr><trclass="SFunction SIndent1 SMarked"><tdclass=SEntry><ahref="#BST.max" id=link13onMouseOver="ShowTip(event, 'tt5', 'link13')" onMouseOut="HideTip('tt5')">max</a></td><tdclass=SDescription>Find the key of the node with the highest key number.</td></tr><trclass="SFunction SIndent1"><tdclass=SEntry><ahref="#BST.successor" id=link14onMouseOver="ShowTip(event, 'tt6', 'link14')" onMouseOut="HideTip('tt6')">successor</a></td><tdclass=SDescription>Find the key that successes the root node.</td></tr><trclass="SFunction SIndent1 SMarked"><tdclass=SEntry><ahref="#BST.predecessor" id=link15onMouseOver="ShowTip(event, 'tt7', 'link15')" onMouseOut="HideTip('tt7')">predecessor</a></td><tdclass=SDescription>Find the key that preceeds the root node.</td></tr><trclass="SFunction SIndent1"><tdclass=SEntry><ahref="#BST.root" id=link16onMouseOver="ShowTip(event, 'tt8', 'link16')" onMouseOut="HideTip('tt8')">root</a></td><tdclass=SDescription>The key of the root node.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="BST.search"></a>search</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>search: function (</td><tdclass="PParameter prettyprint " nowrap>key</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Search through a binary tree.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>key</td><tdclass=CDLDescription>the key to search for.</td></tr></table><h4class=CHeading>Returns</h4><p>the value of the found node, or null if no node was found, or undefined if no key was specified.</p></div></div></div>
19
+
20
+
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="BST.insert"></a>insert</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>insert: function (</td><tdclass="PParameter prettyprint " nowrap>key,</td></tr><tr><td></td><tdclass="PParameter prettyprint " nowrap>value</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Insert into a binary tree.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>key</td><tdclass=CDLDescription>the key to search for.</td></tr><tr><tdclass=CDLEntry>value</td><tdclass=CDLDescription>the value to associate with the key (any type of object).</td></tr></table><h4class=CHeading>Returns</h4><p>true, or undefined if no key was specified.</p></div></div></div>
21
+
22
+
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="BST.traverse"></a>traverse</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>traverse: function (</td><tdclass="PParameter prettyprint " nowrap>callback</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote><p>Call a function on each node of a binary tree.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>callback</td><tdclass=CDLDescription>the function to call on each node, this function takes a key and a value as parameters. If no callback is specified, print is called.</td></tr></table><h4class=CHeading>Returns</h4><p>true.</p></div></div></div>
23
+
24
+
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="BST.min"></a>min</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">min: function ()</td></tr></table></blockquote><p>Find the key of the node with the lowest key number.</p><h4class=CHeading>Parameters</h4><p>none</p><h4class=CHeading>Returns</h4><p>the key of the node with the lowest key number.</p></div></div></div>
25
+
26
+
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="BST.max"></a>max</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">max: function ()</td></tr></table></blockquote><p>Find the key of the node with the highest key number.</p><h4class=CHeading>Parameters</h4><p>none</p><h4class=CHeading>Returns</h4><p>the key of the node with the highest key number.</p></div></div></div>
27
+
28
+
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="BST.successor"></a>successor</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">successor: function ()</td></tr></table></blockquote><p>Find the key that successes the root node.</p><h4class=CHeading>Parameters</h4><p>none</p><h4class=CHeading>Returns</h4><p>the key of the node that successes the root node.</p></div></div></div>
29
+
30
+
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="BST.predecessor"></a>predecessor</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">predecessor: function ()</td></tr></table></blockquote><p>Find the key that preceeds the root node.</p><h4class=CHeading>Parameters</h4><p>none</p><h4class=CHeading>Returns</h4><p>the key of the node that preceeds the root node.</p></div></div></div>
31
+
32
+
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="BST.root"></a>root</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">root: function ()</td></tr></table></blockquote><p>The key of the root node.</p><h4class=CHeading>Parameters</h4><p>none</p><h4class=CHeading>Returns</h4><p>the key of the root node.</p></div></div></div>
33
+
34
+
</div><!--Content-->
35
+
36
+
37
+
38
+
<!--START_ND_TOOLTIPS-->
39
+
<divclass=CToolTipid="tt1"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>search: function (</td><tdclass="PParameter prettyprint " nowrap>key</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Search through a binary tree.</div></div><divclass=CToolTipid="tt2"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>insert: function (</td><tdclass="PParameter prettyprint " nowrap>key,</td></tr><tr><td></td><tdclass="PParameter prettyprint " nowrap>value</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Insert into a binary tree.</div></div><divclass=CToolTipid="tt3"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass="PBeforeParameters prettyprint "nowrap>traverse: function (</td><tdclass="PParameter prettyprint " nowrap>callback</td><tdclass="PAfterParameters prettyprint "nowrap>)</td></tr></table></td></tr></table></blockquote>Call a function on each node of a binary tree.</div></div><divclass=CToolTipid="tt4"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">min: function ()</td></tr></table></blockquote>Find the key of the node with the lowest key number.</div></div><divclass=CToolTipid="tt5"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">max: function ()</td></tr></table></blockquote>Find the key of the node with the highest key number.</div></div><divclass=CToolTipid="tt6"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">successor: function ()</td></tr></table></blockquote>Find the key that successes the root node.</div></div><divclass=CToolTipid="tt7"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">predecessor: function ()</td></tr></table></blockquote>Find the key that preceeds the root node.</div></div><divclass=CToolTipid="tt8"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype"><tr><tdclass="prettyprint">root: function ()</td></tr></table></blockquote>The key of the root node.</div></div><!--END_ND_TOOLTIPS-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN" "http://www.w3.org/TR/REC-html40/frameset.dtd"><html><head><metahttp-equiv="Content-Type" content="text/html; charset=UTF-8"><title></title></head>
2
+
3
+
<!-- Generated by Natural Docs, version 1.51 -->
4
+
<!-- http://www.naturaldocs.org -->
5
+
6
+
<!-- saved from url=(0026)http://www.naturaldocs.org -->
7
+
8
+
<framesetcols="185,*"><framename=Menusrc="menu.html"><framename=Contentsrc="files/bst-js.html"></frameset><noframes>This documentation was designed for use with frames. However, you can still use it by <ahref="menu.html">starting from the menu page</a>.<scriptlanguage=JavaScript><!--
<!-- saved from url=(0026)http://www.naturaldocs.org -->
13
+
14
+
15
+
16
+
17
+
<divid=Index><divclass=IPageTitle>Class Index</div><divclass=INavigationBar>$#! · 0-9 · A · <ahref="#B">B</a> · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z</div><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=IHeadingid=IFirstHeading><aname="B"></a>B</td><td></td></tr><tr><tdclass=ISymbolPrefixid=IOnlySymbolPrefix> </td><tdclass=IEntry><ahref="../files/bst-js.html#BST" id=link1onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')" class=ISymbol>BST</a></td></tr></table>
18
+
<!--START_ND_TOOLTIPS-->
19
+
<divclass=CToolTipid="tt1"><divclass=CClass>The binary search tree class.</div></div><!--END_ND_TOOLTIPS-->
<!-- saved from url=(0026)http://www.naturaldocs.org -->
13
+
14
+
15
+
16
+
17
+
<divid=Index><divclass=IPageTitle>File Index</div><divclass=INavigationBar>$#! · 0-9 · A · <ahref="#B">B</a> · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z</div><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=IHeadingid=IFirstHeading><aname="B"></a>B</td><td></td></tr><tr><tdclass=ISymbolPrefixid=IOnlySymbolPrefix> </td><tdclass=IEntry><ahref="../files/bst-js.html#bst.js" id=link1onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')" class=ISymbol>bst.js</a></td></tr></table>
18
+
<!--START_ND_TOOLTIPS-->
19
+
<divclass=CToolTipid="tt1"><divclass=CFile>A pure JavaScript implementation of a binary search tree.</div></div><!--END_ND_TOOLTIPS-->
0 commit comments