Documentation for 652c2d2650
738
d4/d32/inorder__successor__of__bst_8cpp.html
Normal file
@@ -0,0 +1,738 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Doxygen 1.9.1"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: operations_on_datastructures/inorder_successor_of_bst.cpp File Reference</title>
|
||||
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../jquery.js"></script>
|
||||
<script type="text/javascript" src="../../dynsections.js"></script>
|
||||
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../resize.js"></script>
|
||||
<script type="text/javascript" src="../../navtreedata.js"></script>
|
||||
<script type="text/javascript" src="../../navtree.js"></script>
|
||||
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="../../search/search.js"></script>
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
|
||||
jax: ["input/TeX","output/HTML-CSS"],
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
|
||||
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<div id="projectname">Algorithms_in_C++
|
||||
 <span id="projectnumber">1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.9.1 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
||||
var searchBox = new SearchBox("searchBox", "../../search",false,'Search','.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="../../menudata.js"></script>
|
||||
<script type="text/javascript" src="../../menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
||||
$(function() {
|
||||
initMenu('../../',true,false,'search.php','Search');
|
||||
$(document).ready(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */</script>
|
||||
<div id="main-nav"></div>
|
||||
</div><!-- top -->
|
||||
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
||||
<div id="nav-tree">
|
||||
<div id="nav-tree-contents">
|
||||
<div id="nav-sync" class="sync"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="splitbar" style="-moz-user-select:none;"
|
||||
class="ui-resizable-handle">
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
||||
$(document).ready(function(){initNavTree('d4/d32/inorder__successor__of__bst_8cpp.html','../../'); initResizable(); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
<div id="doc-content">
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="summary">
|
||||
<a href="#nested-classes">Classes</a> |
|
||||
<a href="#namespaces">Namespaces</a> |
|
||||
<a href="#func-members">Functions</a> </div>
|
||||
<div class="headertitle">
|
||||
<div class="title">inorder_successor_of_bst.cpp File Reference</div> </div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p>An implementation for finding the <a href="https://www.youtube.com/watch?v=5cPbNCrdotA">Inorder successor of a binary search tree</a> Inorder successor of a node is the next node in Inorder traversal of the Binary Tree. Inorder Successor is NULL for the last node in Inorder traversal.
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <cassert></code><br />
|
||||
<code>#include <iostream></code><br />
|
||||
<code>#include <vector></code><br />
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for inorder_successor_of_bst.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d7/d66/inorder__successor__of__bst_8cpp__incl.svg" width="258" height="127"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
|
||||
Classes</h2></td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">operations_on_datastructures::inorder_traversal_of_bst::Node</a></td></tr>
|
||||
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">A <a class="el" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html" title="A Node structure representing a single node in BST.">Node</a> structure representing a single node in BST. <a href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html#details">More...</a><br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d58/class_test_cases.html">TestCases</a></td></tr>
|
||||
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">class encapsulating the necessary test cases <a href="../../d5/d58/class_test_cases.html#details">More...</a><br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a>
|
||||
Namespaces</h2></td></tr>
|
||||
<tr class="memitem:da/d6d/namespaceoperations__on__datastructures"><td class="memItemLeft" align="right" valign="top">  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d6d/namespaceoperations__on__datastructures.html">operations_on_datastructures</a></td></tr>
|
||||
<tr class="memdesc:da/d6d/namespaceoperations__on__datastructures"><td class="mdescLeft"> </td><td class="mdescRight">for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a> <br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:dd/d74/namespaceinorder__successor__of__bst"><td class="memItemLeft" align="right" valign="top">  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d74/namespaceinorder__successor__of__bst.html">inorder_successor_of_bst</a></td></tr>
|
||||
<tr class="memdesc:dd/d74/namespaceinorder__successor__of__bst"><td class="mdescLeft"> </td><td class="mdescRight">Functions for the <a href="https://www.youtube.com/watch?v=5cPbNCrdotA">Inorder successor of a binary search tree</a> implementation. <br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table><table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:a4852816cc9f28f7b9def0e5beb4e8545"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../db/d8b/struct_node.html">Node</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a4852816cc9f28f7b9def0e5beb4e8545">operations_on_datastructures::inorder_traversal_of_bst::makeNode</a> (int64_t <a class="el" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>)</td></tr>
|
||||
<tr class="memdesc:a4852816cc9f28f7b9def0e5beb4e8545"><td class="mdescLeft"> </td><td class="mdescRight">Allocates a new node in heap for given data and returns it's pointer. <a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a4852816cc9f28f7b9def0e5beb4e8545">More...</a><br /></td></tr>
|
||||
<tr class="separator:a4852816cc9f28f7b9def0e5beb4e8545"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a2153df6265379da9bda259af3f46556a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../db/d8b/struct_node.html">Node</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a2153df6265379da9bda259af3f46556a">operations_on_datastructures::inorder_traversal_of_bst::Insert</a> (<a class="el" href="../../db/d8b/struct_node.html">Node</a> *root, int64_t <a class="el" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>)</td></tr>
|
||||
<tr class="memdesc:a2153df6265379da9bda259af3f46556a"><td class="mdescLeft"> </td><td class="mdescRight">Inserts the given data in BST while maintaining the properties of BST. <a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a2153df6265379da9bda259af3f46556a">More...</a><br /></td></tr>
|
||||
<tr class="separator:a2153df6265379da9bda259af3f46556a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a744afaca22fa7bb91c92209a26f23e8f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../db/d8b/struct_node.html">Node</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a744afaca22fa7bb91c92209a26f23e8f">operations_on_datastructures::inorder_traversal_of_bst::getNode</a> (<a class="el" href="../../db/d8b/struct_node.html">Node</a> *root, int64_t <a class="el" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>)</td></tr>
|
||||
<tr class="memdesc:a744afaca22fa7bb91c92209a26f23e8f"><td class="mdescLeft"> </td><td class="mdescRight">Searches the given data in BST and returns the pointer to the node containing that data. <a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a744afaca22fa7bb91c92209a26f23e8f">More...</a><br /></td></tr>
|
||||
<tr class="separator:a744afaca22fa7bb91c92209a26f23e8f"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a25667588088eb647887d1c2bff0efa8c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../db/d8b/struct_node.html">Node</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a25667588088eb647887d1c2bff0efa8c">operations_on_datastructures::inorder_traversal_of_bst::findMinNode</a> (<a class="el" href="../../db/d8b/struct_node.html">Node</a> *root)</td></tr>
|
||||
<tr class="memdesc:a25667588088eb647887d1c2bff0efa8c"><td class="mdescLeft"> </td><td class="mdescRight">Finds and return the minimum node in BST. <a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a25667588088eb647887d1c2bff0efa8c">More...</a><br /></td></tr>
|
||||
<tr class="separator:a25667588088eb647887d1c2bff0efa8c"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a5d7266b934ca50c4f53e4f1e725d89a4"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a5d7266b934ca50c4f53e4f1e725d89a4">operations_on_datastructures::inorder_traversal_of_bst::printInorder</a> (<a class="el" href="../../db/d8b/struct_node.html">Node</a> *root)</td></tr>
|
||||
<tr class="memdesc:a5d7266b934ca50c4f53e4f1e725d89a4"><td class="mdescLeft"> </td><td class="mdescRight">Prints the BST in inorder traversal using recursion. <a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a5d7266b934ca50c4f53e4f1e725d89a4">More...</a><br /></td></tr>
|
||||
<tr class="separator:a5d7266b934ca50c4f53e4f1e725d89a4"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ad0ca93be4f9576bfb715a4864a30dbee"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../db/d8b/struct_node.html">Node</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#ad0ca93be4f9576bfb715a4864a30dbee">operations_on_datastructures::inorder_traversal_of_bst::makeBST</a> (<a class="el" href="../../db/d8b/struct_node.html">Node</a> *root, const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< int64_t > &<a class="el" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>)</td></tr>
|
||||
<tr class="memdesc:ad0ca93be4f9576bfb715a4864a30dbee"><td class="mdescLeft"> </td><td class="mdescRight">This function is used in test cases to quickly create BST containing large data instead of hard coding it in code. For a given root, this will add all the nodes containing data passes in data vector. <a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#ad0ca93be4f9576bfb715a4864a30dbee">More...</a><br /></td></tr>
|
||||
<tr class="separator:ad0ca93be4f9576bfb715a4864a30dbee"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a9aa3fac9aa48a6568ecf89aaee190d43"><td class="memItemLeft" align="right" valign="top"><a class="el" href="../../db/d8b/struct_node.html">Node</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a9aa3fac9aa48a6568ecf89aaee190d43">operations_on_datastructures::inorder_traversal_of_bst::getInorderSuccessor</a> (<a class="el" href="../../db/d8b/struct_node.html">Node</a> *root, int64_t <a class="el" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>)</td></tr>
|
||||
<tr class="memdesc:a9aa3fac9aa48a6568ecf89aaee190d43"><td class="mdescLeft"> </td><td class="mdescRight">Inorder successor of a node is the next node in inorder traversal of the Binary Tree. This function takes the root node and the data of the node for which we have to find the inorder successor, and returns the inorder successor node. <a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a9aa3fac9aa48a6568ecf89aaee190d43">More...</a><br /></td></tr>
|
||||
<tr class="separator:a9aa3fac9aa48a6568ecf89aaee190d43"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a7b20eb99272665c1777949e26ab59589"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a7b20eb99272665c1777949e26ab59589">operations_on_datastructures::inorder_traversal_of_bst::deallocate</a> (<a class="el" href="../../db/d8b/struct_node.html">Node</a> *rootNode)</td></tr>
|
||||
<tr class="memdesc:a7b20eb99272665c1777949e26ab59589"><td class="mdescLeft"> </td><td class="mdescRight">This function clears the memory allocated to entire tree recursively. Its just for clean up the memory and not relevant to the actual topic. <a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a7b20eb99272665c1777949e26ab59589">More...</a><br /></td></tr>
|
||||
<tr class="separator:a7b20eb99272665c1777949e26ab59589"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:aa8dca7b867074164d5f45b0f3851269d"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a> ()</td></tr>
|
||||
<tr class="memdesc:aa8dca7b867074164d5f45b0f3851269d"><td class="mdescLeft"> </td><td class="mdescRight">Self-test implementations. <a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">More...</a><br /></td></tr>
|
||||
<tr class="separator:aa8dca7b867074164d5f45b0f3851269d"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a0ddf1224851353fc92bfbff6f499fa97"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97">main</a> (int argc, char *argv[])</td></tr>
|
||||
<tr class="memdesc:a0ddf1224851353fc92bfbff6f499fa97"><td class="mdescLeft"> </td><td class="mdescRight">Main function. <a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97">More...</a><br /></td></tr>
|
||||
<tr class="separator:a0ddf1224851353fc92bfbff6f499fa97"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p>An implementation for finding the <a href="https://www.youtube.com/watch?v=5cPbNCrdotA">Inorder successor of a binary search tree</a> Inorder successor of a node is the next node in Inorder traversal of the Binary Tree. Inorder Successor is NULL for the last node in Inorder traversal. </p>
|
||||
<h3><a class="anchor" id="autotoc_md76"></a>
|
||||
Case 1: The given node has the right node/subtree</h3>
|
||||
<pre class="fragment"> * In this case, the left-most deepest node in the right subtree will
|
||||
</pre><p> come just after the given node as we go to left deep in inorder.</p><ul>
|
||||
<li>Go deep to left most node in right subtree. OR, we can also say in case if BST, find the minimum of the subtree for a given node.</li>
|
||||
</ul>
|
||||
<h3><a class="anchor" id="autotoc_md77"></a>
|
||||
Case 2: The given node does not have a right node/subtree</h3>
|
||||
<h4><a class="anchor" id="autotoc_md78"></a>
|
||||
Method 1: Use parent pointer (store the address of parent nodes)</h4>
|
||||
<ul>
|
||||
<li>If a node does not have the right subtree, and we already visited the node itself, then the next node will be its parent node according to inorder traversal, and if we are going to parent from left, then the parent would be unvisited.</li>
|
||||
<li>In other words, go to the nearest ancestor for which given node would be in left subtree.</li>
|
||||
</ul>
|
||||
<h4><a class="anchor" id="autotoc_md79"></a>
|
||||
Method 2: Search from the root node</h4>
|
||||
<ul>
|
||||
<li>In case if there is no link from a child node to the parent node, we need to walk down the tree starting from the root node to the given node, by doing so, we are visiting every ancestor of the given node.</li>
|
||||
<li>In order successor would be the deepest node in this path for which given node is in left subtree.</li>
|
||||
</ul>
|
||||
<dl class="section author"><dt>Author</dt><dd><a href="https://github.com/foo290">Nitin Sharma</a> </dd></dl>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="a7b20eb99272665c1777949e26ab59589"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a7b20eb99272665c1777949e26ab59589">◆ </a></span>deallocate()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">void operations_on_datastructures::inorder_traversal_of_bst::deallocate </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype"><a class="el" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> * </td>
|
||||
<td class="paramname"><em>rootNode</em></td><td>)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>This function clears the memory allocated to entire tree recursively. Its just for clean up the memory and not relevant to the actual topic. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">root</td><td>Root node of the tree. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  {</div>
|
||||
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <span class="keywordflow">if</span> (rootNode == <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  }</div>
|
||||
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  <a class="code" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a7b20eb99272665c1777949e26ab59589">deallocate</a>(rootNode->left);</div>
|
||||
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <a class="code" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a7b20eb99272665c1777949e26ab59589">deallocate</a>(rootNode->right);</div>
|
||||
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  <span class="keyword">delete</span> (rootNode);</div>
|
||||
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span> }</div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a7b20eb99272665c1777949e26ab59589"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a7b20eb99272665c1777949e26ab59589">operations_on_datastructures::inorder_traversal_of_bst::deallocate</a></div><div class="ttdeci">void deallocate(Node *rootNode)</div><div class="ttdoc">This function clears the memory allocated to entire tree recursively. Its just for clean up the memor...</div><div class="ttdef"><b>Definition:</b> inorder_successor_of_bst.cpp:210</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/d32/inorder__successor__of__bst_8cpp_a7b20eb99272665c1777949e26ab59589_cgraph.svg" width="210" height="91"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="a25667588088eb647887d1c2bff0efa8c"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a25667588088eb647887d1c2bff0efa8c">◆ </a></span>findMinNode()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname"><a class="el" href="../../db/d8b/struct_node.html">Node</a>* operations_on_datastructures::inorder_traversal_of_bst::findMinNode </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype"><a class="el" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> * </td>
|
||||
<td class="paramname"><em>root</em></td><td>)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Finds and return the minimum node in BST. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">root</td><td>A pointer to root node. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>Node* Pointer to the found node </dd></dl>
|
||||
<div class="fragment"><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  {</div>
|
||||
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <span class="keywordflow">if</span> (root == <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <span class="keywordflow">return</span> root;</div>
|
||||
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  }</div>
|
||||
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <span class="keywordflow">while</span> (root->left != <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  root = root->left;</div>
|
||||
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  }</div>
|
||||
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <span class="keywordflow">return</span> root;</div>
|
||||
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span> }</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/d32/inorder__successor__of__bst_8cpp_a25667588088eb647887d1c2bff0efa8c_cgraph.svg" width="210" height="91"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="a9aa3fac9aa48a6568ecf89aaee190d43"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a9aa3fac9aa48a6568ecf89aaee190d43">◆ </a></span>getInorderSuccessor()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname"><a class="el" href="../../db/d8b/struct_node.html">Node</a>* operations_on_datastructures::inorder_traversal_of_bst::getInorderSuccessor </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype"><a class="el" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> * </td>
|
||||
<td class="paramname"><em>root</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int64_t </td>
|
||||
<td class="paramname"><em>data</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Inorder successor of a node is the next node in inorder traversal of the Binary Tree. This function takes the root node and the data of the node for which we have to find the inorder successor, and returns the inorder successor node. </p>
|
||||
<p>Search from the root node as we need to walk the tree starting from the root node to the given node, by doing so, we are visiting every ancestor of the given node. In order successor would be the deepest node in this path for which given node is in left subtree. Time complexity O(h) </p><dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">root</td><td>A pointer to the root node of the BST </td></tr>
|
||||
<tr><td class="paramname">data</td><td>The data (or the data of node) for which we have to find inorder successor. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="../../db/d8b/struct_node.html">Node</a> pointer to the inorder successor node. </dd></dl>
|
||||
<div class="fragment"><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  {</div>
|
||||
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <a class="code" href="../../db/d8b/struct_node.html">Node</a> *current = <a class="code" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a744afaca22fa7bb91c92209a26f23e8f">getNode</a>(root, <a class="code" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>);</div>
|
||||
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  <span class="keywordflow">if</span> (current == <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  }</div>
|
||||
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  </div>
|
||||
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  <span class="comment">// Case - 1</span></div>
|
||||
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <span class="keywordflow">if</span> (current->right != <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  <span class="keywordflow">return</span> <a class="code" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a25667588088eb647887d1c2bff0efa8c">findMinNode</a>(current->right);</div>
|
||||
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  }</div>
|
||||
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <span class="comment">// case - 2</span></div>
|
||||
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <a class="code" href="../../db/d8b/struct_node.html">Node</a> *successor = <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <a class="code" href="../../db/d8b/struct_node.html">Node</a> *ancestor = root;</div>
|
||||
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  </div>
|
||||
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  <span class="keywordflow">while</span> (ancestor != current && ancestor != <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="comment">// This means my current node is in left of the root node</span></div>
|
||||
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  <span class="keywordflow">if</span> (current->data < ancestor->data) {</div>
|
||||
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  successor = ancestor;</div>
|
||||
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  ancestor = ancestor->left; <span class="comment">// keep going left</span></div>
|
||||
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  ancestor = ancestor->right;</div>
|
||||
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  }</div>
|
||||
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  }</div>
|
||||
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  <span class="keywordflow">return</span> successor; <span class="comment">// Nodes with maximum vales will not have a successor</span></div>
|
||||
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  }</div>
|
||||
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span> }</div>
|
||||
<div class="ttc" id="ahash__search_8cpp_html_a6e1a77282bc65ad359d753d25df23243"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a></div><div class="ttdeci">int data[MAX]</div><div class="ttdoc">test data</div><div class="ttdef"><b>Definition:</b> hash_search.cpp:24</div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a25667588088eb647887d1c2bff0efa8c"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a25667588088eb647887d1c2bff0efa8c">operations_on_datastructures::inorder_traversal_of_bst::findMinNode</a></div><div class="ttdeci">Node * findMinNode(Node *root)</div><div class="ttdoc">Finds and return the minimum node in BST.</div><div class="ttdef"><b>Definition:</b> inorder_successor_of_bst.cpp:121</div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a744afaca22fa7bb91c92209a26f23e8f"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a744afaca22fa7bb91c92209a26f23e8f">operations_on_datastructures::inorder_traversal_of_bst::getNode</a></div><div class="ttdeci">Node * getNode(Node *root, int64_t data)</div><div class="ttdoc">Searches the given data in BST and returns the pointer to the node containing that data.</div><div class="ttdef"><b>Definition:</b> inorder_successor_of_bst.cpp:100</div></div>
|
||||
<div class="ttc" id="astruct_node_html"><div class="ttname"><a href="../../db/d8b/struct_node.html">Node</a></div><div class="ttdef"><b>Definition:</b> linkedlist_implentation_usingarray.cpp:14</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/d32/inorder__successor__of__bst_8cpp_a9aa3fac9aa48a6568ecf89aaee190d43_cgraph.svg" width="210" height="91"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="a744afaca22fa7bb91c92209a26f23e8f"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a744afaca22fa7bb91c92209a26f23e8f">◆ </a></span>getNode()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname"><a class="el" href="../../db/d8b/struct_node.html">Node</a>* operations_on_datastructures::inorder_traversal_of_bst::getNode </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype"><a class="el" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> * </td>
|
||||
<td class="paramname"><em>root</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int64_t </td>
|
||||
<td class="paramname"><em>data</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Searches the given data in BST and returns the pointer to the node containing that data. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">root</td><td>Pointer to the root node of the BST </td></tr>
|
||||
<tr><td class="paramname">data</td><td>Data to be Searched. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>Node* pointer to the found node </dd></dl>
|
||||
<p><a class="el" href="../../db/d8b/struct_node.html">Node</a> found!</p>
|
||||
<p>Traverse right subtree recursively as the given data is greater than the data in root node, data must be present in right subtree.</p>
|
||||
<p>Traverse left subtree recursively as the given data is less than the data in root node, data must be present in left subtree.</p>
|
||||
<div class="fragment"><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  {</div>
|
||||
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="keywordflow">if</span> (root == <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div>
|
||||
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (root-><a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/data.html">data</a> == <a class="code" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>) {</div>
|
||||
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="keywordflow">return</span> root; <span class="comment">/// Node found!</span></div>
|
||||
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (<a class="code" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a> > root-><a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/data.html">data</a>) {<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span> <span class="comment"> /// Traverse right subtree recursively as the given data is greater than</span></div>
|
||||
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span> <span class="comment"> /// the data in root node, data must be present in right subtree.</span></div>
|
||||
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span> <span class="comment"></span> <span class="keywordflow">return</span> <a class="code" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a744afaca22fa7bb91c92209a26f23e8f">getNode</a>(root->right, <a class="code" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>);</div>
|
||||
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  } <span class="keywordflow">else</span> {<span class="comment"></span></div>
|
||||
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span> <span class="comment"> /// Traverse left subtree recursively as the given data is less than the</span></div>
|
||||
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span> <span class="comment"> /// data in root node, data must be present in left subtree.</span></div>
|
||||
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span> <span class="comment"></span> <span class="keywordflow">return</span> <a class="code" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a744afaca22fa7bb91c92209a26f23e8f">getNode</a>(root->left, <a class="code" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>);</div>
|
||||
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  }</div>
|
||||
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span> }</div>
|
||||
<div class="ttc" id="adata_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/data.html">std::vector::data</a></div><div class="ttdeci">T data(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/d32/inorder__successor__of__bst_8cpp_a744afaca22fa7bb91c92209a26f23e8f_cgraph.svg" width="210" height="91"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="a2153df6265379da9bda259af3f46556a"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a2153df6265379da9bda259af3f46556a">◆ </a></span>Insert()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname"><a class="el" href="../../db/d8b/struct_node.html">Node</a>* operations_on_datastructures::inorder_traversal_of_bst::Insert </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype"><a class="el" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> * </td>
|
||||
<td class="paramname"><em>root</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int64_t </td>
|
||||
<td class="paramname"><em>data</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Inserts the given data in BST while maintaining the properties of BST. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">root</td><td>Pointer to the root node of the BST </td></tr>
|
||||
<tr><td class="paramname">data</td><td>Data to be inserted. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>Node* Pointer to the root node. </dd></dl>
|
||||
<div class="fragment"><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  {</div>
|
||||
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <span class="keywordflow">if</span> (root == <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  root = <a class="code" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a4852816cc9f28f7b9def0e5beb4e8545">makeNode</a>(<a class="code" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>);</div>
|
||||
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (data <= root-><a class="code" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>) {</div>
|
||||
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  root->left = Insert(root->left, <a class="code" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>);</div>
|
||||
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  root->right = Insert(root->right, <a class="code" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>);</div>
|
||||
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  }</div>
|
||||
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="keywordflow">return</span> root;</div>
|
||||
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span> }</div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a4852816cc9f28f7b9def0e5beb4e8545"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a4852816cc9f28f7b9def0e5beb4e8545">operations_on_datastructures::inorder_traversal_of_bst::makeNode</a></div><div class="ttdeci">Node * makeNode(int64_t data)</div><div class="ttdoc">Allocates a new node in heap for given data and returns it's pointer.</div><div class="ttdef"><b>Definition:</b> inorder_successor_of_bst.cpp:68</div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="a0ddf1224851353fc92bfbff6f499fa97"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a0ddf1224851353fc92bfbff6f499fa97">◆ </a></span>main()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">int main </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>argc</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">char * </td>
|
||||
<td class="paramname"><em>argv</em>[] </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Main function. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">argc</td><td>commandline argument count (ignored) </td></tr>
|
||||
<tr><td class="paramname">argv</td><td>commandline array of arguments (ignored) </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
<p>< root node of the bst</p>
|
||||
<p>< Data to add nodes in BST</p>
|
||||
<p>< An element to find inorder successor for.</p>
|
||||
<p>< Making BST</p>
|
||||
<p>memory cleanup!</p>
|
||||
<div class="fragment"><div class="line"><a name="l00398"></a><span class="lineno"> 398</span>  {</div>
|
||||
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  <a class="code" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>  </div>
|
||||
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  <a class="code" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">operations_on_datastructures::inorder_traversal_of_bst::Node</a> *root =</div>
|
||||
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  <span class="keyword">nullptr</span>; <span class="comment">///< root node of the bst</span></div>
|
||||
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>  <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<int64_t></a> node_data{3, 4, 5,</div>
|
||||
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span>  89, 1, 2}; <span class="comment">///< Data to add nodes in BST</span></div>
|
||||
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  </div>
|
||||
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>  int64_t targetElement = 4; <span class="comment">///< An element to find inorder successor for.</span></div>
|
||||
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>  root = <a class="code" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#ad0ca93be4f9576bfb715a4864a30dbee">operations_on_datastructures::inorder_traversal_of_bst::makeBST</a>(</div>
|
||||
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>  root, node_data); <span class="comment">///< Making BST</span></div>
|
||||
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span>  </div>
|
||||
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span>  <a class="code" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">operations_on_datastructures::inorder_traversal_of_bst::Node</a></div>
|
||||
<div class="line"><a name="l00411"></a><span class="lineno"> 411</span>  *inorderSuccessor = operations_on_datastructures::</div>
|
||||
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>  inorder_traversal_of_bst::getInorderSuccessor(root, targetElement);</div>
|
||||
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>  </div>
|
||||
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>  <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"In-order sequence is : "</span>;</div>
|
||||
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span>  <a class="code" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a5d7266b934ca50c4f53e4f1e725d89a4">operations_on_datastructures::inorder_traversal_of_bst::printInorder</a>(root);</div>
|
||||
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>  <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>  </div>
|
||||
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>  <span class="keywordflow">if</span> (inorderSuccessor == <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>  <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Inorder successor for last node is NULL"</span> << <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>  } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>  <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Target element is : "</span> << targetElement << <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>  <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Inorder successor for target element is : "</span></div>
|
||||
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>  << inorderSuccessor-><a class="code" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html#ae161f3e5ef33ade73429cab9291612e2">data</a> << <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a name="l00424"></a><span class="lineno"> 424</span>  }</div>
|
||||
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>  </div>
|
||||
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span>  <a class="code" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a7b20eb99272665c1777949e26ab59589">deallocate</a>(root); <span class="comment">/// memory cleanup!</span></div>
|
||||
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>  </div>
|
||||
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>  <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a name="l00429"></a><span class="lineno"> 429</span> }</div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="aclassoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node_html"><div class="ttname"><a href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">operations_on_datastructures::inorder_traversal_of_bst::Node</a></div><div class="ttdoc">A Node structure representing a single node in BST.</div><div class="ttdef"><b>Definition:</b> inorder_successor_of_bst.cpp:56</div></div>
|
||||
<div class="ttc" id="aclassoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node_html_ae161f3e5ef33ade73429cab9291612e2"><div class="ttname"><a href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html#ae161f3e5ef33ade73429cab9291612e2">operations_on_datastructures::inorder_traversal_of_bst::Node::data</a></div><div class="ttdeci">int64_t data</div><div class="ttdoc">The key/value of the node.</div><div class="ttdef"><b>Definition:</b> inorder_successor_of_bst.cpp:58</div></div>
|
||||
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_a5d7266b934ca50c4f53e4f1e725d89a4"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a5d7266b934ca50c4f53e4f1e725d89a4">operations_on_datastructures::inorder_traversal_of_bst::printInorder</a></div><div class="ttdeci">void printInorder(Node *root)</div><div class="ttdoc">Prints the BST in inorder traversal using recursion.</div><div class="ttdef"><b>Definition:</b> inorder_successor_of_bst.cpp:136</div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition:</b> inorder_successor_of_bst.cpp:387</div></div>
|
||||
<div class="ttc" id="ainorder__successor__of__bst_8cpp_html_ad0ca93be4f9576bfb715a4864a30dbee"><div class="ttname"><a href="../../d4/d32/inorder__successor__of__bst_8cpp.html#ad0ca93be4f9576bfb715a4864a30dbee">operations_on_datastructures::inorder_traversal_of_bst::makeBST</a></div><div class="ttdeci">Node * makeBST(Node *root, const std::vector< int64_t > &data)</div><div class="ttdoc">This function is used in test cases to quickly create BST containing large data instead of hard codin...</div><div class="ttdef"><b>Definition:</b> inorder_successor_of_bst.cpp:155</div></div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector< int64_t ></a></div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d4/d32/inorder__successor__of__bst_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph.svg" width="100%" height="442"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="ad0ca93be4f9576bfb715a4864a30dbee"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ad0ca93be4f9576bfb715a4864a30dbee">◆ </a></span>makeBST()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname"><a class="el" href="../../db/d8b/struct_node.html">Node</a>* operations_on_datastructures::inorder_traversal_of_bst::makeBST </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype"><a class="el" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> * </td>
|
||||
<td class="paramname"><em>root</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a>< int64_t > & </td>
|
||||
<td class="paramname"><em>data</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>This function is used in test cases to quickly create BST containing large data instead of hard coding it in code. For a given root, this will add all the nodes containing data passes in data vector. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">root</td><td>Pointer to the root node. </td></tr>
|
||||
<tr><td class="paramname">data</td><td>A vector containing integer values which are suppose to be inserted as nodes in BST. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="../../db/d8b/struct_node.html">Node</a> pointer to the root node. </dd></dl>
|
||||
<div class="fragment"><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  {</div>
|
||||
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  <span class="keywordflow">for</span> (int64_t values : <a class="code" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>) {</div>
|
||||
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  root = Insert(root, values);</div>
|
||||
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  }</div>
|
||||
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <span class="keywordflow">return</span> root;</div>
|
||||
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span> }</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/d32/inorder__successor__of__bst_8cpp_ad0ca93be4f9576bfb715a4864a30dbee_cgraph.svg" width="210" height="91"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="a4852816cc9f28f7b9def0e5beb4e8545"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a4852816cc9f28f7b9def0e5beb4e8545">◆ </a></span>makeNode()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname"><a class="el" href="../../db/d8b/struct_node.html">Node</a>* operations_on_datastructures::inorder_traversal_of_bst::makeNode </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">int64_t </td>
|
||||
<td class="paramname"><em>data</em></td><td>)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Allocates a new node in heap for given data and returns it's pointer. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">data</td><td>Data for the node. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>A pointer to the newly allocated <a class="el" href="../../db/d8b/struct_node.html">Node</a>. </dd></dl>
|
||||
<p>< setting data for node</p>
|
||||
<p>< setting left child as null</p>
|
||||
<p>< setting right child as null</p>
|
||||
<div class="fragment"><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  {</div>
|
||||
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <a class="code" href="../../db/d8b/struct_node.html">Node</a> *<a class="code" href="../../d5/da1/structnode.html">node</a> = <span class="keyword">new</span> <a class="code" href="../../db/d8b/struct_node.html">Node</a>();</div>
|
||||
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <a class="code" href="../../d5/da1/structnode.html">node</a>->data = <a class="code" href="../../d1/df3/hash__search_8cpp.html#a6e1a77282bc65ad359d753d25df23243">data</a>; <span class="comment">///< setting data for node</span></div>
|
||||
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <a class="code" href="../../d5/da1/structnode.html">node</a>->left = <span class="keyword">nullptr</span>; <span class="comment">///< setting left child as null</span></div>
|
||||
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <a class="code" href="../../d5/da1/structnode.html">node</a>->right = <span class="keyword">nullptr</span>; <span class="comment">///< setting right child as null</span></div>
|
||||
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="keywordflow">return</span> <a class="code" href="../../d1/df3/hash__search_8cpp.html#a8ca8dcb494104d273679e219e53d0555">node</a>;</div>
|
||||
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span> }</div>
|
||||
<div class="ttc" id="ahash__search_8cpp_html_a8ca8dcb494104d273679e219e53d0555"><div class="ttname"><a href="../../d1/df3/hash__search_8cpp.html#a8ca8dcb494104d273679e219e53d0555">node</a></div><div class="ttdeci">struct list node</div></div>
|
||||
<div class="ttc" id="astructnode_html"><div class="ttname"><a href="../../d5/da1/structnode.html">node</a></div><div class="ttdef"><b>Definition:</b> avltree.cpp:13</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/d32/inorder__successor__of__bst_8cpp_a4852816cc9f28f7b9def0e5beb4e8545_cgraph.svg" width="210" height="91"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="a5d7266b934ca50c4f53e4f1e725d89a4"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a5d7266b934ca50c4f53e4f1e725d89a4">◆ </a></span>printInorder()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">void operations_on_datastructures::inorder_traversal_of_bst::printInorder </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype"><a class="el" href="../../d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html">Node</a> * </td>
|
||||
<td class="paramname"><em>root</em></td><td>)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Prints the BST in inorder traversal using recursion. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">root</td><td>A pointer to the root node of the BST. </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<p>recursive call to left subtree</p>
|
||||
<p>recursive call to right subtree</p>
|
||||
<div class="fragment"><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  {</div>
|
||||
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="keywordflow">if</span> (root == <span class="keyword">nullptr</span>) {</div>
|
||||
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <span class="keywordflow">return</span>;</div>
|
||||
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  }</div>
|
||||
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  </div>
|
||||
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <a class="code" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a5d7266b934ca50c4f53e4f1e725d89a4">printInorder</a>(root->left); <span class="comment">/// recursive call to left subtree</span></div>
|
||||
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << root-><a class="codeRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/data.html">data</a> << <span class="stringliteral">" "</span>;</div>
|
||||
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  <a class="code" href="../../d4/d32/inorder__successor__of__bst_8cpp.html#a5d7266b934ca50c4f53e4f1e725d89a4">printInorder</a>(root->right); <span class="comment">/// recursive call to right subtree</span></div>
|
||||
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span> }</div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d4/d32/inorder__successor__of__bst_8cpp_a5d7266b934ca50c4f53e4f1e725d89a4_cgraph.svg" width="210" height="91"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="aa8dca7b867074164d5f45b0f3851269d"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#aa8dca7b867074164d5f45b0f3851269d">◆ </a></span>test()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="mlabels">
|
||||
<tr>
|
||||
<td class="mlabels-left">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">static void test </td>
|
||||
<td>(</td>
|
||||
<td class="paramname"></td><td>)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td class="mlabels-right">
|
||||
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Self-test implementations. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
<div class="fragment"><div class="line"><a name="l00387"></a><span class="lineno"> 387</span>  {</div>
|
||||
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>  <a class="code" href="../../d5/d58/class_test_cases.html">TestCases</a> tc;</div>
|
||||
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  tc.<a class="code" href="../../d5/d58/class_test_cases.html#aeabea90c02f9159e4a784bbf736e1e23">runTests</a>();</div>
|
||||
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span> }</div>
|
||||
<div class="ttc" id="aclass_test_cases_html"><div class="ttname"><a href="../../d5/d58/class_test_cases.html">TestCases</a></div><div class="ttdoc">class encapsulating the necessary test cases</div><div class="ttdef"><b>Definition:</b> inorder_successor_of_bst.cpp:225</div></div>
|
||||
<div class="ttc" id="aclass_test_cases_html_aeabea90c02f9159e4a784bbf736e1e23"><div class="ttname"><a href="../../d5/d58/class_test_cases.html#aeabea90c02f9159e4a784bbf736e1e23">TestCases::runTests</a></div><div class="ttdeci">void runTests()</div><div class="ttdoc">Executes test cases.</div><div class="ttdef"><b>Definition:</b> inorder_successor_of_bst.cpp:243</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d4/d32/inorder__successor__of__bst_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg" width="100%" height="442"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_35422be6552f1b3672c1b6c4aba2da64.html">operations_on_datastructures</a></li><li class="navelem"><a class="el" href="../../d4/d32/inorder__successor__of__bst_8cpp.html">inorder_successor_of_bst.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
15
d4/d32/inorder__successor__of__bst_8cpp.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
var inorder__successor__of__bst_8cpp =
|
||||
[
|
||||
[ "Node", "d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node.html", "d5/db5/classoperations__on__datastructures_1_1inorder__traversal__of__bst_1_1_node" ],
|
||||
[ "TestCases", "d5/d58/class_test_cases.html", "d5/d58/class_test_cases" ],
|
||||
[ "deallocate", "d4/d32/inorder__successor__of__bst_8cpp.html#a7b20eb99272665c1777949e26ab59589", null ],
|
||||
[ "findMinNode", "d4/d32/inorder__successor__of__bst_8cpp.html#a25667588088eb647887d1c2bff0efa8c", null ],
|
||||
[ "getInorderSuccessor", "d4/d32/inorder__successor__of__bst_8cpp.html#a9aa3fac9aa48a6568ecf89aaee190d43", null ],
|
||||
[ "getNode", "d4/d32/inorder__successor__of__bst_8cpp.html#a744afaca22fa7bb91c92209a26f23e8f", null ],
|
||||
[ "Insert", "d4/d32/inorder__successor__of__bst_8cpp.html#a2153df6265379da9bda259af3f46556a", null ],
|
||||
[ "main", "d4/d32/inorder__successor__of__bst_8cpp.html#a0ddf1224851353fc92bfbff6f499fa97", null ],
|
||||
[ "makeBST", "d4/d32/inorder__successor__of__bst_8cpp.html#ad0ca93be4f9576bfb715a4864a30dbee", null ],
|
||||
[ "makeNode", "d4/d32/inorder__successor__of__bst_8cpp.html#a4852816cc9f28f7b9def0e5beb4e8545", null ],
|
||||
[ "printInorder", "d4/d32/inorder__successor__of__bst_8cpp.html#a5d7266b934ca50c4f53e4f1e725d89a4", null ],
|
||||
[ "test", "d4/d32/inorder__successor__of__bst_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ]
|
||||
];
|
||||
@@ -0,0 +1,10 @@
|
||||
<map id="main" name="main">
|
||||
<area shape="rect" id="node1" title="Main function." alt="" coords="5,56,56,83"/>
|
||||
<area shape="rect" id="node2" href="$d4/d32/inorder__successor__of__bst_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" title="Self-test implementations." alt="" coords="104,56,148,83"/>
|
||||
<area shape="rect" id="node3" href="$d5/d58/class_test_cases.html#aeabea90c02f9159e4a784bbf736e1e23" title="Executes test cases." alt="" coords="196,56,339,83"/>
|
||||
<area shape="rect" id="node4" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="751,5,823,32"/>
|
||||
<area shape="rect" id="node5" href="$d5/d58/class_test_cases.html#aa3aa3d5bf666f327ee8e2d11d397b06e" title="A function to print given message on console." alt="" coords="593,56,703,83"/>
|
||||
<area shape="rect" id="node6" href="$d5/d58/class_test_cases.html#ac2636e8b5b9e053374c45bfcf0603008" title="A test case contains edge case, printing inorder successor of last node." alt="" coords="387,56,545,83"/>
|
||||
<area shape="rect" id="node7" href="$d5/d58/class_test_cases.html#abae0148985f159b582a385cf399254e3" title="A test case which contains main list of 100 elements and sublist of 20." alt="" coords="387,107,545,133"/>
|
||||
<area shape="rect" id="node8" href="$d5/d58/class_test_cases.html#ad9f95c09931625b41e3be1f88d1e28c5" title="A test case which contains main list of 50 elements and sublist of 20." alt="" coords="387,157,545,184"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
e2e29f58d25e0b39ed9236e44711a256
|
||||
@@ -0,0 +1,239 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.47.3 (20210619.1520)
|
||||
-->
|
||||
<!-- Title: main Pages: 1 -->
|
||||
<!--zoomable 142 -->
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" onload="init(evt)">
|
||||
<style type="text/css"><![CDATA[
|
||||
.edge:hover path { stroke: red; }
|
||||
.edge:hover polygon { stroke: red; fill: red; }
|
||||
]]></style>
|
||||
<script type="text/javascript"><![CDATA[
|
||||
var edges = document.getElementsByTagName('g');
|
||||
if (edges && edges.length) {
|
||||
for (var i=0;i<edges.length;i++) {
|
||||
if (edges[i].id.substr(0,4)=='edge') {
|
||||
edges[i].setAttribute('class','edge');
|
||||
}
|
||||
}
|
||||
}
|
||||
]]></script>
|
||||
<defs>
|
||||
<circle id="rim" cx="0" cy="0" r="7"/>
|
||||
<circle id="rim2" cx="0" cy="0" r="3.5"/>
|
||||
<g id="zoomPlus">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="zoomplus.mouseover" end="zoomplus.mouseout"/>
|
||||
</use>
|
||||
<path d="M-4,0h8M0,-4v8" fill="none" stroke="white" stroke-width="1.5" pointer-events="none"/>
|
||||
</g>
|
||||
<g id="zoomMin">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="zoomminus.mouseover" end="zoomminus.mouseout"/>
|
||||
</use>
|
||||
<path d="M-4,0h8" fill="none" stroke="white" stroke-width="1.5" pointer-events="none"/>
|
||||
</g>
|
||||
<g id="dirArrow">
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="resetDef">
|
||||
<use xlink:href="#rim2" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="reset.mouseover" end="reset.mouseout"/>
|
||||
</use>
|
||||
</g>
|
||||
</defs>
|
||||
|
||||
<script type="text/javascript">
|
||||
var viewWidth = 621;
|
||||
var viewHeight = 142;
|
||||
var sectionId = 'dynsection-5';
|
||||
</script>
|
||||
<script xlink:href="../../svgpan.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="viewport">
|
||||
<title>main</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-138 617,-138 617,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Main function.">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-76.5 0,-95.5 38,-95.5 38,-76.5 0,-76.5"/>
|
||||
<text text-anchor="middle" x="19" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a xlink:href="../../d4/d32/inorder__successor__of__bst_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" target="_top" xlink:title="Self-test implementations.">
|
||||
<polygon fill="white" stroke="black" points="74,-76.5 74,-95.5 107,-95.5 107,-76.5 74,-76.5"/>
|
||||
<text text-anchor="middle" x="90.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.26,-86C46.07,-86 55.31,-86 63.79,-86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="63.95,-89.5 73.95,-86 63.95,-82.5 63.95,-89.5"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a xlink:href="../../d5/d58/class_test_cases.html#aeabea90c02f9159e4a784bbf736e1e23" target="_top" xlink:title="Executes test cases.">
|
||||
<polygon fill="white" stroke="black" points="143,-76.5 143,-95.5 250,-95.5 250,-76.5 143,-76.5"/>
|
||||
<text text-anchor="middle" x="196.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::runTests</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M107.3,-86C114.46,-86 123.46,-86 132.94,-86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="132.94,-89.5 142.94,-86 132.94,-82.5 132.94,-89.5"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="559,-114.5 559,-133.5 613,-133.5 613,-114.5 559,-114.5"/>
|
||||
<text text-anchor="middle" x="586" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node3->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M215.88,-95.58C233.37,-104.13 260.71,-116.05 286,-121 379.09,-139.22 491.62,-132.96 548.41,-127.88"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="549.05,-131.34 558.68,-126.92 548.4,-124.37 549.05,-131.34"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a xlink:href="../../d5/d58/class_test_cases.html#aa3aa3d5bf666f327ee8e2d11d397b06e" target="_top" xlink:title="A function to print given message on console.">
|
||||
<polygon fill="white" stroke="black" points="441,-76.5 441,-95.5 523,-95.5 523,-76.5 441,-76.5"/>
|
||||
<text text-anchor="middle" x="482" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::log</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node5 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>Node3->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M233.39,-95.51C249.37,-99.27 268.5,-103.14 286,-105 338.59,-110.58 352.51,-111.46 405,-105 416.69,-103.56 429.17,-100.92 440.57,-98.06"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="441.48,-101.44 450.26,-95.51 439.7,-94.67 441.48,-101.44"/>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a xlink:href="../../d5/d58/class_test_cases.html#ac2636e8b5b9e053374c45bfcf0603008" target="_top" xlink:title="A test case contains edge case, printing inorder successor of last node.">
|
||||
<polygon fill="white" stroke="black" points="286,-76.5 286,-95.5 405,-95.5 405,-76.5 286,-76.5"/>
|
||||
<text text-anchor="middle" x="345.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::testCase_1</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node6 -->
|
||||
<g id="edge6" class="edge">
|
||||
<title>Node3->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M250.16,-86C258.5,-86 267.24,-86 275.89,-86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="275.98,-89.5 285.98,-86 275.98,-82.5 275.98,-89.5"/>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a xlink:href="../../d5/d58/class_test_cases.html#abae0148985f159b582a385cf399254e3" target="_top" xlink:title="A test case which contains main list of 100 elements and sublist of 20.">
|
||||
<polygon fill="white" stroke="black" points="286,-38.5 286,-57.5 405,-57.5 405,-38.5 286,-38.5"/>
|
||||
<text text-anchor="middle" x="345.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::testCase_2</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node7 -->
|
||||
<g id="edge8" class="edge">
|
||||
<title>Node3->Node7</title>
|
||||
<path fill="none" stroke="midnightblue" d="M234.59,-76.41C253.82,-71.44 277.49,-65.32 297.93,-60.04"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="298.87,-63.41 307.67,-57.52 297.11,-56.63 298.87,-63.41"/>
|
||||
</g>
|
||||
<!-- Node8 -->
|
||||
<g id="node8" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_node8"><a xlink:href="../../d5/d58/class_test_cases.html#ad9f95c09931625b41e3be1f88d1e28c5" target="_top" xlink:title="A test case which contains main list of 50 elements and sublist of 20.">
|
||||
<polygon fill="white" stroke="black" points="286,-0.5 286,-19.5 405,-19.5 405,-0.5 286,-0.5"/>
|
||||
<text text-anchor="middle" x="345.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::testCase_3</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node8 -->
|
||||
<g id="edge10" class="edge">
|
||||
<title>Node3->Node8</title>
|
||||
<path fill="none" stroke="midnightblue" d="M210.08,-76.4C226.71,-64.07 257.27,-42.63 286,-29 290.64,-26.8 295.61,-24.75 300.61,-22.88"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="301.93,-26.12 310.2,-19.5 299.61,-19.52 301.93,-26.12"/>
|
||||
</g>
|
||||
<!-- Node5->Node4 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>Node5->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M508.74,-95.59C521.18,-100.22 536.31,-105.86 549.8,-110.89"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="548.68,-114.2 559.27,-114.41 551.12,-107.64 548.68,-114.2"/>
|
||||
</g>
|
||||
<!-- Node6->Node5 -->
|
||||
<g id="edge7" class="edge">
|
||||
<title>Node6->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M405.1,-86C413.56,-86 422.21,-86 430.5,-86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="430.76,-89.5 440.76,-86 430.76,-82.5 430.76,-89.5"/>
|
||||
</g>
|
||||
<!-- Node7->Node5 -->
|
||||
<g id="edge9" class="edge">
|
||||
<title>Node7->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M380.44,-57.59C397.72,-62.47 418.93,-68.46 437.41,-73.68"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="436.5,-77.06 447.07,-76.41 438.4,-70.33 436.5,-77.06"/>
|
||||
</g>
|
||||
<!-- Node8->Node5 -->
|
||||
<g id="edge11" class="edge">
|
||||
<title>Node8->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M382.22,-19.53C389.93,-22.15 397.89,-25.31 405,-29 426.29,-40.05 447.92,-56.95 462.64,-69.48"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="460.6,-72.35 470.44,-76.27 465.2,-67.07 460.6,-72.35"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
<g id="navigator" transform="translate(0 0)" fill="#404254">
|
||||
<rect fill="#f2f5e9" fill-opacity="0.5" stroke="#606060" stroke-width=".5" x="0" y="0" width="60" height="60"/>
|
||||
<use id="zoomplus" xlink:href="#zoomPlus" x="17" y="9" onmousedown="handleZoom(evt,'in')"/>
|
||||
<use id="zoomminus" xlink:href="#zoomMin" x="42" y="9" onmousedown="handleZoom(evt,'out')"/>
|
||||
<use id="reset" xlink:href="#resetDef" x="30" y="36" onmousedown="handleReset()"/>
|
||||
<g id="arrowUp" xlink:href="#dirArrow" transform="translate(30 24)" onmousedown="handlePan(0,-1)">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="arrowUp.mouseover" end="arrowUp.mouseout"/>
|
||||
</use>
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="arrowRight" xlink:href="#dirArrow" transform="rotate(90) translate(36 -43)" onmousedown="handlePan(1,0)">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="arrowRight.mouseover" end="arrowRight.mouseout"/>
|
||||
</use>
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="arrowDown" xlink:href="#dirArrow" transform="rotate(180) translate(-30 -48)" onmousedown="handlePan(0,1)">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="arrowDown.mouseover" end="arrowDown.mouseout"/>
|
||||
</use>
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="arrowLeft" xlink:href="#dirArrow" transform="rotate(270) translate(-36 17)" onmousedown="handlePan(-1,0)">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="arrowLeft.mouseover" end="arrowLeft.mouseout"/>
|
||||
</use>
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
</g>
|
||||
<svg viewBox="0 0 15 15" width="100%" height="30px" preserveAspectRatio="xMaxYMin meet">
|
||||
<g id="arrow_out" transform="scale(0.3 0.3)">
|
||||
<a xlink:href="inorder__successor__of__bst_8cpp_a0ddf1224851353fc92bfbff6f499fa97_cgraph_org.svg" target="_base">
|
||||
<rect id="button" ry="5" rx="5" y="6" x="6" height="38" width="38"
|
||||
fill="#f2f5e9" fill-opacity="0.5" stroke="#606060" stroke-width="1.0"/>
|
||||
<path id="arrow"
|
||||
d="M 11.500037,31.436501 C 11.940474,20.09759 22.043105,11.32322 32.158766,21.979434 L 37.068811,17.246167 C 37.068811,17.246167 37.088388,32 37.088388,32 L 22.160133,31.978069 C 22.160133,31.978069 26.997745,27.140456 26.997745,27.140456 C 18.528582,18.264221 13.291696,25.230495 11.500037,31.436501 z"
|
||||
style="fill:#404040;"/>
|
||||
</a>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,151 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.47.3 (20210619.1520)
|
||||
-->
|
||||
<!-- Title: main Pages: 1 -->
|
||||
<svg width="621pt" height="142pt"
|
||||
viewBox="0.00 0.00 621.00 142.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 138)">
|
||||
<title>main</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-138 617,-138 617,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Main function.">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-76.5 0,-95.5 38,-95.5 38,-76.5 0,-76.5"/>
|
||||
<text text-anchor="middle" x="19" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a xlink:href="../../d4/d32/inorder__successor__of__bst_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" target="_top" xlink:title="Self-test implementations.">
|
||||
<polygon fill="white" stroke="black" points="74,-76.5 74,-95.5 107,-95.5 107,-76.5 74,-76.5"/>
|
||||
<text text-anchor="middle" x="90.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M38.26,-86C46.07,-86 55.31,-86 63.79,-86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="63.95,-89.5 73.95,-86 63.95,-82.5 63.95,-89.5"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a xlink:href="../../d5/d58/class_test_cases.html#aeabea90c02f9159e4a784bbf736e1e23" target="_top" xlink:title="Executes test cases.">
|
||||
<polygon fill="white" stroke="black" points="143,-76.5 143,-95.5 250,-95.5 250,-76.5 143,-76.5"/>
|
||||
<text text-anchor="middle" x="196.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::runTests</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M107.3,-86C114.46,-86 123.46,-86 132.94,-86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="132.94,-89.5 142.94,-86 132.94,-82.5 132.94,-89.5"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="559,-114.5 559,-133.5 613,-133.5 613,-114.5 559,-114.5"/>
|
||||
<text text-anchor="middle" x="586" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node3->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M215.88,-95.58C233.37,-104.13 260.71,-116.05 286,-121 379.09,-139.22 491.62,-132.96 548.41,-127.88"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="549.05,-131.34 558.68,-126.92 548.4,-124.37 549.05,-131.34"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a xlink:href="../../d5/d58/class_test_cases.html#aa3aa3d5bf666f327ee8e2d11d397b06e" target="_top" xlink:title="A function to print given message on console.">
|
||||
<polygon fill="white" stroke="black" points="441,-76.5 441,-95.5 523,-95.5 523,-76.5 441,-76.5"/>
|
||||
<text text-anchor="middle" x="482" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::log</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node5 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>Node3->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M233.39,-95.51C249.37,-99.27 268.5,-103.14 286,-105 338.59,-110.58 352.51,-111.46 405,-105 416.69,-103.56 429.17,-100.92 440.57,-98.06"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="441.48,-101.44 450.26,-95.51 439.7,-94.67 441.48,-101.44"/>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a xlink:href="../../d5/d58/class_test_cases.html#ac2636e8b5b9e053374c45bfcf0603008" target="_top" xlink:title="A test case contains edge case, printing inorder successor of last node.">
|
||||
<polygon fill="white" stroke="black" points="286,-76.5 286,-95.5 405,-95.5 405,-76.5 286,-76.5"/>
|
||||
<text text-anchor="middle" x="345.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::testCase_1</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node6 -->
|
||||
<g id="edge6" class="edge">
|
||||
<title>Node3->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M250.16,-86C258.5,-86 267.24,-86 275.89,-86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="275.98,-89.5 285.98,-86 275.98,-82.5 275.98,-89.5"/>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a xlink:href="../../d5/d58/class_test_cases.html#abae0148985f159b582a385cf399254e3" target="_top" xlink:title="A test case which contains main list of 100 elements and sublist of 20.">
|
||||
<polygon fill="white" stroke="black" points="286,-38.5 286,-57.5 405,-57.5 405,-38.5 286,-38.5"/>
|
||||
<text text-anchor="middle" x="345.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::testCase_2</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node7 -->
|
||||
<g id="edge8" class="edge">
|
||||
<title>Node3->Node7</title>
|
||||
<path fill="none" stroke="midnightblue" d="M234.59,-76.41C253.82,-71.44 277.49,-65.32 297.93,-60.04"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="298.87,-63.41 307.67,-57.52 297.11,-56.63 298.87,-63.41"/>
|
||||
</g>
|
||||
<!-- Node8 -->
|
||||
<g id="node8" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_node8"><a xlink:href="../../d5/d58/class_test_cases.html#ad9f95c09931625b41e3be1f88d1e28c5" target="_top" xlink:title="A test case which contains main list of 50 elements and sublist of 20.">
|
||||
<polygon fill="white" stroke="black" points="286,-0.5 286,-19.5 405,-19.5 405,-0.5 286,-0.5"/>
|
||||
<text text-anchor="middle" x="345.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::testCase_3</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node8 -->
|
||||
<g id="edge10" class="edge">
|
||||
<title>Node3->Node8</title>
|
||||
<path fill="none" stroke="midnightblue" d="M210.08,-76.4C226.71,-64.07 257.27,-42.63 286,-29 290.64,-26.8 295.61,-24.75 300.61,-22.88"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="301.93,-26.12 310.2,-19.5 299.61,-19.52 301.93,-26.12"/>
|
||||
</g>
|
||||
<!-- Node5->Node4 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>Node5->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M508.74,-95.59C521.18,-100.22 536.31,-105.86 549.8,-110.89"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="548.68,-114.2 559.27,-114.41 551.12,-107.64 548.68,-114.2"/>
|
||||
</g>
|
||||
<!-- Node6->Node5 -->
|
||||
<g id="edge7" class="edge">
|
||||
<title>Node6->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M405.1,-86C413.56,-86 422.21,-86 430.5,-86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="430.76,-89.5 440.76,-86 430.76,-82.5 430.76,-89.5"/>
|
||||
</g>
|
||||
<!-- Node7->Node5 -->
|
||||
<g id="edge9" class="edge">
|
||||
<title>Node7->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M380.44,-57.59C397.72,-62.47 418.93,-68.46 437.41,-73.68"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="436.5,-77.06 447.07,-76.41 438.4,-70.33 436.5,-77.06"/>
|
||||
</g>
|
||||
<!-- Node8->Node5 -->
|
||||
<g id="edge11" class="edge">
|
||||
<title>Node8->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M382.22,-19.53C389.93,-22.15 397.89,-25.31 405,-29 426.29,-40.05 447.92,-56.95 462.64,-69.48"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="460.6,-72.35 470.44,-76.27 465.2,-67.07 460.6,-72.35"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 7.7 KiB |
@@ -0,0 +1,3 @@
|
||||
<map id="operations_on_datastructures::inorder_traversal_of_bst::findMinNode" name="operations_on_datastructures::inorder_traversal_of_bst::findMinNode">
|
||||
<area shape="rect" id="node1" title="Finds and return the minimum node in BST." alt="" coords="5,29,204,85"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
98116e169b6bec24c5d449688cdbb704
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.47.3 (20210619.1520)
|
||||
-->
|
||||
<!-- Title: operations_on_datastructures::inorder_traversal_of_bst::findMinNode Pages: 1 -->
|
||||
<svg width="157pt" height="68pt"
|
||||
viewBox="0.00 0.00 157.00 68.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 64)">
|
||||
<title>operations_on_datastructures::inorder_traversal_of_bst::findMinNode</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-64 153,-64 153,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Finds and return the minimum node in BST.">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-41.5 149,-41.5 149,-0.5 0,-0.5"/>
|
||||
<text text-anchor="start" x="8" y="-29.5" font-family="Helvetica,sans-Serif" font-size="10.00">operations_on_datastructures</text>
|
||||
<text text-anchor="start" x="8" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">::inorder_traversal_of_bst</text>
|
||||
<text text-anchor="middle" x="74.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">::findMinNode</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node1 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node1</title>
|
||||
<path fill="none" stroke="midnightblue" d="M47.3,-41.86C44.33,-51.54 53.4,-60 74.5,-60 87.69,-60 96.18,-56.7 99.96,-51.86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="103.43,-52.32 101.7,-41.86 96.54,-51.12 103.43,-52.32"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,3 @@
|
||||
<map id="operations_on_datastructures::inorder_traversal_of_bst::makeNode" name="operations_on_datastructures::inorder_traversal_of_bst::makeNode">
|
||||
<area shape="rect" id="node1" title="Allocates a new node in heap for given data and returns it's pointer." alt="" coords="5,29,204,85"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
9840c3d8af7efe8c22f0f0f42186210b
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.47.3 (20210619.1520)
|
||||
-->
|
||||
<!-- Title: operations_on_datastructures::inorder_traversal_of_bst::makeNode Pages: 1 -->
|
||||
<svg width="157pt" height="68pt"
|
||||
viewBox="0.00 0.00 157.00 68.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 64)">
|
||||
<title>operations_on_datastructures::inorder_traversal_of_bst::makeNode</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-64 153,-64 153,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Allocates a new node in heap for given data and returns it's pointer.">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-41.5 149,-41.5 149,-0.5 0,-0.5"/>
|
||||
<text text-anchor="start" x="8" y="-29.5" font-family="Helvetica,sans-Serif" font-size="10.00">operations_on_datastructures</text>
|
||||
<text text-anchor="start" x="8" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">::inorder_traversal_of_bst</text>
|
||||
<text text-anchor="middle" x="74.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">::makeNode</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node1 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node1</title>
|
||||
<path fill="none" stroke="midnightblue" d="M47.3,-41.86C44.33,-51.54 53.4,-60 74.5,-60 87.69,-60 96.18,-56.7 99.96,-51.86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="103.43,-52.32 101.7,-41.86 96.54,-51.12 103.43,-52.32"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,3 @@
|
||||
<map id="operations_on_datastructures::inorder_traversal_of_bst::printInorder" name="operations_on_datastructures::inorder_traversal_of_bst::printInorder">
|
||||
<area shape="rect" id="node1" title="Prints the BST in inorder traversal using recursion." alt="" coords="5,29,204,85"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
e0f1c24313a256e5f8f8cf20580ae974
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.47.3 (20210619.1520)
|
||||
-->
|
||||
<!-- Title: operations_on_datastructures::inorder_traversal_of_bst::printInorder Pages: 1 -->
|
||||
<svg width="157pt" height="68pt"
|
||||
viewBox="0.00 0.00 157.00 68.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 64)">
|
||||
<title>operations_on_datastructures::inorder_traversal_of_bst::printInorder</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-64 153,-64 153,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Prints the BST in inorder traversal using recursion.">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-41.5 149,-41.5 149,-0.5 0,-0.5"/>
|
||||
<text text-anchor="start" x="8" y="-29.5" font-family="Helvetica,sans-Serif" font-size="10.00">operations_on_datastructures</text>
|
||||
<text text-anchor="start" x="8" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">::inorder_traversal_of_bst</text>
|
||||
<text text-anchor="middle" x="74.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">::printInorder</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node1 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node1</title>
|
||||
<path fill="none" stroke="midnightblue" d="M47.3,-41.86C44.33,-51.54 53.4,-60 74.5,-60 87.69,-60 96.18,-56.7 99.96,-51.86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="103.43,-52.32 101.7,-41.86 96.54,-51.12 103.43,-52.32"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,3 @@
|
||||
<map id="operations_on_datastructures::inorder_traversal_of_bst::getNode" name="operations_on_datastructures::inorder_traversal_of_bst::getNode">
|
||||
<area shape="rect" id="node1" title="Searches the given data in BST and returns the pointer to the node containing that data." alt="" coords="5,29,204,85"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
c8215d87446a8331c5f2295f046a5d3d
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.47.3 (20210619.1520)
|
||||
-->
|
||||
<!-- Title: operations_on_datastructures::inorder_traversal_of_bst::getNode Pages: 1 -->
|
||||
<svg width="157pt" height="68pt"
|
||||
viewBox="0.00 0.00 157.00 68.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 64)">
|
||||
<title>operations_on_datastructures::inorder_traversal_of_bst::getNode</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-64 153,-64 153,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Searches the given data in BST and returns the pointer to the node containing that data.">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-41.5 149,-41.5 149,-0.5 0,-0.5"/>
|
||||
<text text-anchor="start" x="8" y="-29.5" font-family="Helvetica,sans-Serif" font-size="10.00">operations_on_datastructures</text>
|
||||
<text text-anchor="start" x="8" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">::inorder_traversal_of_bst</text>
|
||||
<text text-anchor="middle" x="74.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">::getNode</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node1 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node1</title>
|
||||
<path fill="none" stroke="midnightblue" d="M47.3,-41.86C44.33,-51.54 53.4,-60 74.5,-60 87.69,-60 96.18,-56.7 99.96,-51.86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="103.43,-52.32 101.7,-41.86 96.54,-51.12 103.43,-52.32"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,3 @@
|
||||
<map id="operations_on_datastructures::inorder_traversal_of_bst::deallocate" name="operations_on_datastructures::inorder_traversal_of_bst::deallocate">
|
||||
<area shape="rect" id="node1" title="This function clears the memory allocated to entire tree recursively. Its just for clean up the memor..." alt="" coords="5,29,204,85"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
2d748e1986f3f669c9d295e23716561d
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.47.3 (20210619.1520)
|
||||
-->
|
||||
<!-- Title: operations_on_datastructures::inorder_traversal_of_bst::deallocate Pages: 1 -->
|
||||
<svg width="157pt" height="68pt"
|
||||
viewBox="0.00 0.00 157.00 68.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 64)">
|
||||
<title>operations_on_datastructures::inorder_traversal_of_bst::deallocate</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-64 153,-64 153,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="This function clears the memory allocated to entire tree recursively. Its just for clean up the memor...">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-41.5 149,-41.5 149,-0.5 0,-0.5"/>
|
||||
<text text-anchor="start" x="8" y="-29.5" font-family="Helvetica,sans-Serif" font-size="10.00">operations_on_datastructures</text>
|
||||
<text text-anchor="start" x="8" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">::inorder_traversal_of_bst</text>
|
||||
<text text-anchor="middle" x="74.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">::deallocate</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node1 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node1</title>
|
||||
<path fill="none" stroke="midnightblue" d="M47.3,-41.86C44.33,-51.54 53.4,-60 74.5,-60 87.69,-60 96.18,-56.7 99.96,-51.86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="103.43,-52.32 101.7,-41.86 96.54,-51.12 103.43,-52.32"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,3 @@
|
||||
<map id="operations_on_datastructures::inorder_traversal_of_bst::getInorderSuccessor" name="operations_on_datastructures::inorder_traversal_of_bst::getInorderSuccessor">
|
||||
<area shape="rect" id="node1" title="Inorder successor of a node is the next node in inorder traversal of the Binary Tree...." alt="" coords="5,29,204,85"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
a4aa86d37999e783d2034a506f0343b1
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.47.3 (20210619.1520)
|
||||
-->
|
||||
<!-- Title: operations_on_datastructures::inorder_traversal_of_bst::getInorderSuccessor Pages: 1 -->
|
||||
<svg width="157pt" height="68pt"
|
||||
viewBox="0.00 0.00 157.00 68.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 64)">
|
||||
<title>operations_on_datastructures::inorder_traversal_of_bst::getInorderSuccessor</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-64 153,-64 153,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Inorder successor of a node is the next node in inorder traversal of the Binary Tree....">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-41.5 149,-41.5 149,-0.5 0,-0.5"/>
|
||||
<text text-anchor="start" x="8" y="-29.5" font-family="Helvetica,sans-Serif" font-size="10.00">operations_on_datastructures</text>
|
||||
<text text-anchor="start" x="8" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">::inorder_traversal_of_bst</text>
|
||||
<text text-anchor="middle" x="74.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">::getInorderSuccessor</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node1 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node1</title>
|
||||
<path fill="none" stroke="midnightblue" d="M47.3,-41.86C44.33,-51.54 53.4,-60 74.5,-60 87.69,-60 96.18,-56.7 99.96,-51.86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="103.43,-52.32 101.7,-41.86 96.54,-51.12 103.43,-52.32"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@@ -0,0 +1,9 @@
|
||||
<map id="test" name="test">
|
||||
<area shape="rect" id="node1" title="Self-test implementations." alt="" coords="5,56,49,83"/>
|
||||
<area shape="rect" id="node2" href="$d5/d58/class_test_cases.html#aeabea90c02f9159e4a784bbf736e1e23" title="Executes test cases." alt="" coords="97,56,240,83"/>
|
||||
<area shape="rect" id="node3" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/io/manip/endl.html#" title=" " alt="" coords="652,5,724,32"/>
|
||||
<area shape="rect" id="node4" href="$d5/d58/class_test_cases.html#aa3aa3d5bf666f327ee8e2d11d397b06e" title="A function to print given message on console." alt="" coords="495,56,604,83"/>
|
||||
<area shape="rect" id="node5" href="$d5/d58/class_test_cases.html#ac2636e8b5b9e053374c45bfcf0603008" title="A test case contains edge case, printing inorder successor of last node." alt="" coords="288,56,447,83"/>
|
||||
<area shape="rect" id="node6" href="$d5/d58/class_test_cases.html#abae0148985f159b582a385cf399254e3" title="A test case which contains main list of 100 elements and sublist of 20." alt="" coords="288,107,447,133"/>
|
||||
<area shape="rect" id="node7" href="$d5/d58/class_test_cases.html#ad9f95c09931625b41e3be1f88d1e28c5" title="A test case which contains main list of 50 elements and sublist of 20." alt="" coords="288,157,447,184"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
8387bcc4b0cc5bb822748e702fc24784
|
||||
@@ -0,0 +1,224 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.47.3 (20210619.1520)
|
||||
-->
|
||||
<!-- Title: test Pages: 1 -->
|
||||
<!--zoomable 142 -->
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" onload="init(evt)">
|
||||
<style type="text/css"><![CDATA[
|
||||
.edge:hover path { stroke: red; }
|
||||
.edge:hover polygon { stroke: red; fill: red; }
|
||||
]]></style>
|
||||
<script type="text/javascript"><![CDATA[
|
||||
var edges = document.getElementsByTagName('g');
|
||||
if (edges && edges.length) {
|
||||
for (var i=0;i<edges.length;i++) {
|
||||
if (edges[i].id.substr(0,4)=='edge') {
|
||||
edges[i].setAttribute('class','edge');
|
||||
}
|
||||
}
|
||||
}
|
||||
]]></script>
|
||||
<defs>
|
||||
<circle id="rim" cx="0" cy="0" r="7"/>
|
||||
<circle id="rim2" cx="0" cy="0" r="3.5"/>
|
||||
<g id="zoomPlus">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="zoomplus.mouseover" end="zoomplus.mouseout"/>
|
||||
</use>
|
||||
<path d="M-4,0h8M0,-4v8" fill="none" stroke="white" stroke-width="1.5" pointer-events="none"/>
|
||||
</g>
|
||||
<g id="zoomMin">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="zoomminus.mouseover" end="zoomminus.mouseout"/>
|
||||
</use>
|
||||
<path d="M-4,0h8" fill="none" stroke="white" stroke-width="1.5" pointer-events="none"/>
|
||||
</g>
|
||||
<g id="dirArrow">
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="resetDef">
|
||||
<use xlink:href="#rim2" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="reset.mouseover" end="reset.mouseout"/>
|
||||
</use>
|
||||
</g>
|
||||
</defs>
|
||||
|
||||
<script type="text/javascript">
|
||||
var viewWidth = 547;
|
||||
var viewHeight = 142;
|
||||
var sectionId = 'dynsection-9';
|
||||
</script>
|
||||
<script xlink:href="../../svgpan.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="viewport">
|
||||
<title>test</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-138 543,-138 543,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Self-test implementations.">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-76.5 0,-95.5 33,-95.5 33,-76.5 0,-76.5"/>
|
||||
<text text-anchor="middle" x="16.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a xlink:href="../../d5/d58/class_test_cases.html#aeabea90c02f9159e4a784bbf736e1e23" target="_top" xlink:title="Executes test cases.">
|
||||
<polygon fill="white" stroke="black" points="69,-76.5 69,-95.5 176,-95.5 176,-76.5 69,-76.5"/>
|
||||
<text text-anchor="middle" x="122.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::runTests</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M33.3,-86C40.46,-86 49.46,-86 58.94,-86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="58.94,-89.5 68.94,-86 58.94,-82.5 58.94,-89.5"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="485,-114.5 485,-133.5 539,-133.5 539,-114.5 485,-114.5"/>
|
||||
<text text-anchor="middle" x="512" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M141.88,-95.58C159.37,-104.13 186.71,-116.05 212,-121 305.09,-139.22 417.62,-132.96 474.41,-127.88"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="475.05,-131.34 484.68,-126.92 474.4,-124.37 475.05,-131.34"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a xlink:href="../../d5/d58/class_test_cases.html#aa3aa3d5bf666f327ee8e2d11d397b06e" target="_top" xlink:title="A function to print given message on console.">
|
||||
<polygon fill="white" stroke="black" points="367,-76.5 367,-95.5 449,-95.5 449,-76.5 367,-76.5"/>
|
||||
<text text-anchor="middle" x="408" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::log</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node2->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M159.39,-95.51C175.37,-99.27 194.5,-103.14 212,-105 264.59,-110.58 278.51,-111.46 331,-105 342.69,-103.56 355.17,-100.92 366.57,-98.06"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="367.48,-101.44 376.26,-95.51 365.7,-94.67 367.48,-101.44"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a xlink:href="../../d5/d58/class_test_cases.html#ac2636e8b5b9e053374c45bfcf0603008" target="_top" xlink:title="A test case contains edge case, printing inorder successor of last node.">
|
||||
<polygon fill="white" stroke="black" points="212,-76.5 212,-95.5 331,-95.5 331,-76.5 212,-76.5"/>
|
||||
<text text-anchor="middle" x="271.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::testCase_1</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node5 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>Node2->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M176.16,-86C184.5,-86 193.24,-86 201.89,-86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="201.98,-89.5 211.98,-86 201.98,-82.5 201.98,-89.5"/>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a xlink:href="../../d5/d58/class_test_cases.html#abae0148985f159b582a385cf399254e3" target="_top" xlink:title="A test case which contains main list of 100 elements and sublist of 20.">
|
||||
<polygon fill="white" stroke="black" points="212,-38.5 212,-57.5 331,-57.5 331,-38.5 212,-38.5"/>
|
||||
<text text-anchor="middle" x="271.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::testCase_2</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node6 -->
|
||||
<g id="edge7" class="edge">
|
||||
<title>Node2->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M160.59,-76.41C179.82,-71.44 203.49,-65.32 223.93,-60.04"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="224.87,-63.41 233.67,-57.52 223.11,-56.63 224.87,-63.41"/>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a xlink:href="../../d5/d58/class_test_cases.html#ad9f95c09931625b41e3be1f88d1e28c5" target="_top" xlink:title="A test case which contains main list of 50 elements and sublist of 20.">
|
||||
<polygon fill="white" stroke="black" points="212,-0.5 212,-19.5 331,-19.5 331,-0.5 212,-0.5"/>
|
||||
<text text-anchor="middle" x="271.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::testCase_3</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node7 -->
|
||||
<g id="edge9" class="edge">
|
||||
<title>Node2->Node7</title>
|
||||
<path fill="none" stroke="midnightblue" d="M136.08,-76.4C152.71,-64.07 183.27,-42.63 212,-29 216.64,-26.8 221.61,-24.75 226.61,-22.88"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="227.93,-26.12 236.2,-19.5 225.61,-19.52 227.93,-26.12"/>
|
||||
</g>
|
||||
<!-- Node4->Node3 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>Node4->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M434.74,-95.59C447.18,-100.22 462.31,-105.86 475.8,-110.89"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="474.68,-114.2 485.27,-114.41 477.12,-107.64 474.68,-114.2"/>
|
||||
</g>
|
||||
<!-- Node5->Node4 -->
|
||||
<g id="edge6" class="edge">
|
||||
<title>Node5->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M331.1,-86C339.56,-86 348.21,-86 356.5,-86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="356.76,-89.5 366.76,-86 356.76,-82.5 356.76,-89.5"/>
|
||||
</g>
|
||||
<!-- Node6->Node4 -->
|
||||
<g id="edge8" class="edge">
|
||||
<title>Node6->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M306.44,-57.59C323.72,-62.47 344.93,-68.46 363.41,-73.68"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="362.5,-77.06 373.07,-76.41 364.4,-70.33 362.5,-77.06"/>
|
||||
</g>
|
||||
<!-- Node7->Node4 -->
|
||||
<g id="edge10" class="edge">
|
||||
<title>Node7->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M308.22,-19.53C315.93,-22.15 323.89,-25.31 331,-29 352.29,-40.05 373.92,-56.95 388.64,-69.48"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="386.6,-72.35 396.44,-76.27 391.2,-67.07 386.6,-72.35"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
<g id="navigator" transform="translate(0 0)" fill="#404254">
|
||||
<rect fill="#f2f5e9" fill-opacity="0.5" stroke="#606060" stroke-width=".5" x="0" y="0" width="60" height="60"/>
|
||||
<use id="zoomplus" xlink:href="#zoomPlus" x="17" y="9" onmousedown="handleZoom(evt,'in')"/>
|
||||
<use id="zoomminus" xlink:href="#zoomMin" x="42" y="9" onmousedown="handleZoom(evt,'out')"/>
|
||||
<use id="reset" xlink:href="#resetDef" x="30" y="36" onmousedown="handleReset()"/>
|
||||
<g id="arrowUp" xlink:href="#dirArrow" transform="translate(30 24)" onmousedown="handlePan(0,-1)">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="arrowUp.mouseover" end="arrowUp.mouseout"/>
|
||||
</use>
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="arrowRight" xlink:href="#dirArrow" transform="rotate(90) translate(36 -43)" onmousedown="handlePan(1,0)">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="arrowRight.mouseover" end="arrowRight.mouseout"/>
|
||||
</use>
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="arrowDown" xlink:href="#dirArrow" transform="rotate(180) translate(-30 -48)" onmousedown="handlePan(0,1)">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="arrowDown.mouseover" end="arrowDown.mouseout"/>
|
||||
</use>
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
<g id="arrowLeft" xlink:href="#dirArrow" transform="rotate(270) translate(-36 17)" onmousedown="handlePan(-1,0)">
|
||||
<use xlink:href="#rim" fill="#404040">
|
||||
<set attributeName="fill" to="#808080" begin="arrowLeft.mouseover" end="arrowLeft.mouseout"/>
|
||||
</use>
|
||||
<path fill="none" stroke="white" stroke-width="1.5" d="M0,-3.0v7 M-2.5,-0.5L0,-3.0L2.5,-0.5"/>
|
||||
</g>
|
||||
</g>
|
||||
<svg viewBox="0 0 15 15" width="100%" height="30px" preserveAspectRatio="xMaxYMin meet">
|
||||
<g id="arrow_out" transform="scale(0.3 0.3)">
|
||||
<a xlink:href="inorder__successor__of__bst_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph_org.svg" target="_base">
|
||||
<rect id="button" ry="5" rx="5" y="6" x="6" height="38" width="38"
|
||||
fill="#f2f5e9" fill-opacity="0.5" stroke="#606060" stroke-width="1.0"/>
|
||||
<path id="arrow"
|
||||
d="M 11.500037,31.436501 C 11.940474,20.09759 22.043105,11.32322 32.158766,21.979434 L 37.068811,17.246167 C 37.068811,17.246167 37.088388,32 37.088388,32 L 22.160133,31.978069 C 22.160133,31.978069 26.997745,27.140456 26.997745,27.140456 C 18.528582,18.264221 13.291696,25.230495 11.500037,31.436501 z"
|
||||
style="fill:#404040;"/>
|
||||
</a>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,136 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.47.3 (20210619.1520)
|
||||
-->
|
||||
<!-- Title: test Pages: 1 -->
|
||||
<svg width="547pt" height="142pt"
|
||||
viewBox="0.00 0.00 547.00 142.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 138)">
|
||||
<title>test</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-138 543,-138 543,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="Self-test implementations.">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-76.5 0,-95.5 33,-95.5 33,-76.5 0,-76.5"/>
|
||||
<text text-anchor="middle" x="16.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="node2" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_node2"><a xlink:href="../../d5/d58/class_test_cases.html#aeabea90c02f9159e4a784bbf736e1e23" target="_top" xlink:title="Executes test cases.">
|
||||
<polygon fill="white" stroke="black" points="69,-76.5 69,-95.5 176,-95.5 176,-76.5 69,-76.5"/>
|
||||
<text text-anchor="middle" x="122.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::runTests</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<path fill="none" stroke="midnightblue" d="M33.3,-86C40.46,-86 49.46,-86 58.94,-86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="58.94,-89.5 68.94,-86 58.94,-82.5 58.94,-89.5"/>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="node3" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_node3"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/io/manip/endl.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="black" points="485,-114.5 485,-133.5 539,-133.5 539,-114.5 485,-114.5"/>
|
||||
<text text-anchor="middle" x="512" y="-121.5" font-family="Helvetica,sans-Serif" font-size="10.00">std::endl</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M141.88,-95.58C159.37,-104.13 186.71,-116.05 212,-121 305.09,-139.22 417.62,-132.96 474.41,-127.88"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="475.05,-131.34 484.68,-126.92 474.4,-124.37 475.05,-131.34"/>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="node4" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_node4"><a xlink:href="../../d5/d58/class_test_cases.html#aa3aa3d5bf666f327ee8e2d11d397b06e" target="_top" xlink:title="A function to print given message on console.">
|
||||
<polygon fill="white" stroke="black" points="367,-76.5 367,-95.5 449,-95.5 449,-76.5 367,-76.5"/>
|
||||
<text text-anchor="middle" x="408" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::log</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node4 -->
|
||||
<g id="edge3" class="edge">
|
||||
<title>Node2->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M159.39,-95.51C175.37,-99.27 194.5,-103.14 212,-105 264.59,-110.58 278.51,-111.46 331,-105 342.69,-103.56 355.17,-100.92 366.57,-98.06"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="367.48,-101.44 376.26,-95.51 365.7,-94.67 367.48,-101.44"/>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="node5" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_node5"><a xlink:href="../../d5/d58/class_test_cases.html#ac2636e8b5b9e053374c45bfcf0603008" target="_top" xlink:title="A test case contains edge case, printing inorder successor of last node.">
|
||||
<polygon fill="white" stroke="black" points="212,-76.5 212,-95.5 331,-95.5 331,-76.5 212,-76.5"/>
|
||||
<text text-anchor="middle" x="271.5" y="-83.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::testCase_1</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node5 -->
|
||||
<g id="edge5" class="edge">
|
||||
<title>Node2->Node5</title>
|
||||
<path fill="none" stroke="midnightblue" d="M176.16,-86C184.5,-86 193.24,-86 201.89,-86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="201.98,-89.5 211.98,-86 201.98,-82.5 201.98,-89.5"/>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="node6" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_node6"><a xlink:href="../../d5/d58/class_test_cases.html#abae0148985f159b582a385cf399254e3" target="_top" xlink:title="A test case which contains main list of 100 elements and sublist of 20.">
|
||||
<polygon fill="white" stroke="black" points="212,-38.5 212,-57.5 331,-57.5 331,-38.5 212,-38.5"/>
|
||||
<text text-anchor="middle" x="271.5" y="-45.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::testCase_2</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node6 -->
|
||||
<g id="edge7" class="edge">
|
||||
<title>Node2->Node6</title>
|
||||
<path fill="none" stroke="midnightblue" d="M160.59,-76.41C179.82,-71.44 203.49,-65.32 223.93,-60.04"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="224.87,-63.41 233.67,-57.52 223.11,-56.63 224.87,-63.41"/>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="node7" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_node7"><a xlink:href="../../d5/d58/class_test_cases.html#ad9f95c09931625b41e3be1f88d1e28c5" target="_top" xlink:title="A test case which contains main list of 50 elements and sublist of 20.">
|
||||
<polygon fill="white" stroke="black" points="212,-0.5 212,-19.5 331,-19.5 331,-0.5 212,-0.5"/>
|
||||
<text text-anchor="middle" x="271.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">TestCases::testCase_3</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node7 -->
|
||||
<g id="edge9" class="edge">
|
||||
<title>Node2->Node7</title>
|
||||
<path fill="none" stroke="midnightblue" d="M136.08,-76.4C152.71,-64.07 183.27,-42.63 212,-29 216.64,-26.8 221.61,-24.75 226.61,-22.88"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="227.93,-26.12 236.2,-19.5 225.61,-19.52 227.93,-26.12"/>
|
||||
</g>
|
||||
<!-- Node4->Node3 -->
|
||||
<g id="edge4" class="edge">
|
||||
<title>Node4->Node3</title>
|
||||
<path fill="none" stroke="midnightblue" d="M434.74,-95.59C447.18,-100.22 462.31,-105.86 475.8,-110.89"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="474.68,-114.2 485.27,-114.41 477.12,-107.64 474.68,-114.2"/>
|
||||
</g>
|
||||
<!-- Node5->Node4 -->
|
||||
<g id="edge6" class="edge">
|
||||
<title>Node5->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M331.1,-86C339.56,-86 348.21,-86 356.5,-86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="356.76,-89.5 366.76,-86 356.76,-82.5 356.76,-89.5"/>
|
||||
</g>
|
||||
<!-- Node6->Node4 -->
|
||||
<g id="edge8" class="edge">
|
||||
<title>Node6->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M306.44,-57.59C323.72,-62.47 344.93,-68.46 363.41,-73.68"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="362.5,-77.06 373.07,-76.41 364.4,-70.33 362.5,-77.06"/>
|
||||
</g>
|
||||
<!-- Node7->Node4 -->
|
||||
<g id="edge10" class="edge">
|
||||
<title>Node7->Node4</title>
|
||||
<path fill="none" stroke="midnightblue" d="M308.22,-19.53C315.93,-22.15 323.89,-25.31 331,-29 352.29,-40.05 373.92,-56.95 388.64,-69.48"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="386.6,-72.35 396.44,-76.27 391.2,-67.07 386.6,-72.35"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.9 KiB |
@@ -0,0 +1,3 @@
|
||||
<map id="operations_on_datastructures::inorder_traversal_of_bst::makeBST" name="operations_on_datastructures::inorder_traversal_of_bst::makeBST">
|
||||
<area shape="rect" id="node1" title="This function is used in test cases to quickly create BST containing large data instead of hard codin..." alt="" coords="5,29,204,85"/>
|
||||
</map>
|
||||
@@ -0,0 +1 @@
|
||||
1fc40f4869b51b8597df81c4eaa43674
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 2.47.3 (20210619.1520)
|
||||
-->
|
||||
<!-- Title: operations_on_datastructures::inorder_traversal_of_bst::makeBST Pages: 1 -->
|
||||
<svg width="157pt" height="68pt"
|
||||
viewBox="0.00 0.00 157.00 68.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 64)">
|
||||
<title>operations_on_datastructures::inorder_traversal_of_bst::makeBST</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-64 153,-64 153,4 -4,4"/>
|
||||
<!-- Node1 -->
|
||||
<g id="node1" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_node1"><a xlink:title="This function is used in test cases to quickly create BST containing large data instead of hard codin...">
|
||||
<polygon fill="#bfbfbf" stroke="black" points="0,-0.5 0,-41.5 149,-41.5 149,-0.5 0,-0.5"/>
|
||||
<text text-anchor="start" x="8" y="-29.5" font-family="Helvetica,sans-Serif" font-size="10.00">operations_on_datastructures</text>
|
||||
<text text-anchor="start" x="8" y="-18.5" font-family="Helvetica,sans-Serif" font-size="10.00">::inorder_traversal_of_bst</text>
|
||||
<text text-anchor="middle" x="74.5" y="-7.5" font-family="Helvetica,sans-Serif" font-size="10.00">::makeBST</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node1 -->
|
||||
<g id="edge1" class="edge">
|
||||
<title>Node1->Node1</title>
|
||||
<path fill="none" stroke="midnightblue" d="M47.3,-41.86C44.33,-51.54 53.4,-60 74.5,-60 87.69,-60 96.18,-56.7 99.96,-51.86"/>
|
||||
<polygon fill="midnightblue" stroke="midnightblue" points="103.43,-52.32 101.7,-41.86 96.54,-51.12 103.43,-52.32"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.7 KiB |