Documentation for 0953376d31

This commit is contained in:
github-actions
2023-06-16 21:18:14 +00:00
parent 26f1eee566
commit 14deeecd50
7241 changed files with 234176 additions and 54779 deletions

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="generator" content="Doxygen 1.9.7"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Algorithms_in_C++: others/postfix_evaluation.cpp File Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
@@ -41,7 +41,7 @@ MathJax.Hub.Config({
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.6 -->
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
@@ -115,8 +115,7 @@ $(document).ready(function(){initNavTree('d7/d75/postfix__evaluation_8cpp.html',
</div><div class="textblock"><div class="dynheader">
Include dependency graph for postfix_evaluation.cpp:</div>
<div class="dyncontent">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d5/dc8/postfix__evaluation_8cpp__incl.svg" width="422" height="111"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d5/dc8/postfix__evaluation_8cpp__incl.svg" width="422" height="111"><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 id="nested-classes" name="nested-classes"></a>
@@ -136,16 +135,16 @@ Namespaces</h2></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ad77f8c9cc594975756838d498c237cea"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d75/postfix__evaluation_8cpp.html#ad77f8c9cc594975756838d498c237cea">others::postfix_expression::push</a> (float operand, Stack *<a class="el" href="../../d1/dc2/classstack.html">stack</a>)</td></tr>
<tr class="memitem:ad77f8c9cc594975756838d498c237cea"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d75/postfix__evaluation_8cpp.html#ad77f8c9cc594975756838d498c237cea">others::postfix_expression::push</a> (float operand, <a class="el" href="../../d5/d8a/classothers_1_1postfix__expression_1_1_stack.html">Stack</a> *<a class="el" href="../../d1/dc2/classstack.html">stack</a>)</td></tr>
<tr class="memdesc:ad77f8c9cc594975756838d498c237cea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pushing operand, also called the number in the array to the stack. <br /></td></tr>
<tr class="separator:ad77f8c9cc594975756838d498c237cea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a421baa2002a64bc0bfc3e1b64800d734"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d75/postfix__evaluation_8cpp.html#a421baa2002a64bc0bfc3e1b64800d734">others::postfix_expression::pop</a> (Stack *<a class="el" href="../../d1/dc2/classstack.html">stack</a>)</td></tr>
<tr class="memitem:a421baa2002a64bc0bfc3e1b64800d734"><td class="memItemLeft" align="right" valign="top">float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d75/postfix__evaluation_8cpp.html#a421baa2002a64bc0bfc3e1b64800d734">others::postfix_expression::pop</a> (<a class="el" href="../../d5/d8a/classothers_1_1postfix__expression_1_1_stack.html">Stack</a> *<a class="el" href="../../d1/dc2/classstack.html">stack</a>)</td></tr>
<tr class="memdesc:a421baa2002a64bc0bfc3e1b64800d734"><td class="mdescLeft">&#160;</td><td class="mdescRight">Popping operand, also called the number from the stack. <br /></td></tr>
<tr class="separator:a421baa2002a64bc0bfc3e1b64800d734"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4c27f949c9d6659be9f5bd2ccbe1360a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d75/postfix__evaluation_8cpp.html#a4c27f949c9d6659be9f5bd2ccbe1360a">others::postfix_expression::is_number</a> (const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> &amp;s)</td></tr>
<tr class="memdesc:a4c27f949c9d6659be9f5bd2ccbe1360a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Checks if scanned string is a number. <br /></td></tr>
<tr class="separator:a4c27f949c9d6659be9f5bd2ccbe1360a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a59fd597e0ea394abe027ced4d2ea3338"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d75/postfix__evaluation_8cpp.html#a59fd597e0ea394abe027ced4d2ea3338">others::postfix_expression::evaluate</a> (float a, float b, const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> &amp;operation, Stack *<a class="el" href="../../d1/dc2/classstack.html">stack</a>)</td></tr>
<tr class="memitem:a59fd597e0ea394abe027ced4d2ea3338"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../d7/d75/postfix__evaluation_8cpp.html#a59fd597e0ea394abe027ced4d2ea3338">others::postfix_expression::evaluate</a> (float a, float b, const <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a> &amp;operation, <a class="el" href="../../d5/d8a/classothers_1_1postfix__expression_1_1_stack.html">Stack</a> *<a class="el" href="../../d1/dc2/classstack.html">stack</a>)</td></tr>
<tr class="memdesc:a59fd597e0ea394abe027ced4d2ea3338"><td class="mdescLeft">&#160;</td><td class="mdescRight">Evaluate answer using given last two operands from and operation. <br /></td></tr>
<tr class="separator:a59fd597e0ea394abe027ced4d2ea3338"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae38bd3a177a6d61da3859a281233bbe1"><td class="memTemplParams" colspan="2">template&lt;<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a> N&gt; </td></tr>
@@ -247,13 +246,12 @@ Functions</h2></td></tr>
<div class="line"><span class="lineno"> 105</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="ac_str_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string/c_str.html">std::string::c_str</a></div><div class="ttdeci">T c_str(T... args)</div></div>
<div class="ttc" id="aclassstack_html"><div class="ttname"><a href="../../d1/dc2/classstack.html">stack</a></div><div class="ttdoc">for std::invalid_argument</div><div class="ttdef"><b>Definition:</b> stack.hpp:19</div></div>
<div class="ttc" id="apostfix__evaluation_8cpp_html_ad77f8c9cc594975756838d498c237cea"><div class="ttname"><a href="../../d7/d75/postfix__evaluation_8cpp.html#ad77f8c9cc594975756838d498c237cea">others::postfix_expression::push</a></div><div class="ttdeci">void push(float operand, Stack *stack)</div><div class="ttdoc">Pushing operand, also called the number in the array to the stack.</div><div class="ttdef"><b>Definition:</b> postfix_evaluation.cpp:44</div></div>
<div class="ttc" id="aclassstack_html"><div class="ttname"><a href="../../d1/dc2/classstack.html">stack</a></div><div class="ttdoc">for std::invalid_argument</div><div class="ttdef"><b>Definition</b> stack.hpp:19</div></div>
<div class="ttc" id="apostfix__evaluation_8cpp_html_ad77f8c9cc594975756838d498c237cea"><div class="ttname"><a href="../../d7/d75/postfix__evaluation_8cpp.html#ad77f8c9cc594975756838d498c237cea">others::postfix_expression::push</a></div><div class="ttdeci">void push(float operand, Stack *stack)</div><div class="ttdoc">Pushing operand, also called the number in the array to the stack.</div><div class="ttdef"><b>Definition</b> postfix_evaluation.cpp:44</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="../../d7/d75/postfix__evaluation_8cpp_a59fd597e0ea394abe027ced4d2ea3338_cgraph.svg" width="408" height="104"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d7/d75/postfix__evaluation_8cpp_a59fd597e0ea394abe027ced4d2ea3338_cgraph.svg" width="408" height="104"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
@@ -292,8 +290,7 @@ Here is the call graph for this function:</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="../../d7/d75/postfix__evaluation_8cpp_a4c27f949c9d6659be9f5bd2ccbe1360a_cgraph.svg" width="356" height="184"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d7/d75/postfix__evaluation_8cpp_a4c27f949c9d6659be9f5bd2ccbe1360a_cgraph.svg" width="356" height="184"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
@@ -324,13 +321,12 @@ Here is the call graph for this function:</div>
<div class="line"><span class="lineno"> 176</span> </div>
<div class="line"><span class="lineno"> 177</span> <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="lineno"> 178</span>}</div>
<div class="ttc" id="apostfix__evaluation_8cpp_html_a5b97d12e8b61484f756a8721992bfae1"><div class="ttname"><a href="../../d7/d75/postfix__evaluation_8cpp.html#a5b97d12e8b61484f756a8721992bfae1">test_function_2</a></div><div class="ttdeci">static void test_function_2()</div><div class="ttdoc">Test function 2 with input array {'1', '2', '+', '2', '/', '5', '*', '7', '+'}.</div><div class="ttdef"><b>Definition:</b> postfix_evaluation.cpp:159</div></div>
<div class="ttc" id="apostfix__evaluation_8cpp_html_a6a8eeb7d346d5cd6335d9780fb7c0f15"><div class="ttname"><a href="../../d7/d75/postfix__evaluation_8cpp.html#a6a8eeb7d346d5cd6335d9780fb7c0f15">test_function_1</a></div><div class="ttdeci">static void test_function_1()</div><div class="ttdoc">Test function 1 with input array {'2', '3', '1', '*', '+', '9', '-'}.</div><div class="ttdef"><b>Definition:</b> postfix_evaluation.cpp:146</div></div>
<div class="ttc" id="apostfix__evaluation_8cpp_html_a5b97d12e8b61484f756a8721992bfae1"><div class="ttname"><a href="../../d7/d75/postfix__evaluation_8cpp.html#a5b97d12e8b61484f756a8721992bfae1">test_function_2</a></div><div class="ttdeci">static void test_function_2()</div><div class="ttdoc">Test function 2 with input array {'1', '2', '+', '2', '/', '5', '*', '7', '+'}.</div><div class="ttdef"><b>Definition</b> postfix_evaluation.cpp:159</div></div>
<div class="ttc" id="apostfix__evaluation_8cpp_html_a6a8eeb7d346d5cd6335d9780fb7c0f15"><div class="ttname"><a href="../../d7/d75/postfix__evaluation_8cpp.html#a6a8eeb7d346d5cd6335d9780fb7c0f15">test_function_1</a></div><div class="ttdeci">static void test_function_1()</div><div class="ttdoc">Test function 1 with input array {'2', '3', '1', '*', '+', '9', '-'}.</div><div class="ttdef"><b>Definition</b> postfix_evaluation.cpp:146</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="../../d7/d75/postfix__evaluation_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="219" height="86"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d7/d75/postfix__evaluation_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="219" height="86"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
@@ -364,7 +360,7 @@ Here is the call graph for this function:</div>
<div class="line"><span class="lineno"> 56</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>-&gt;<a class="code hl_variable" href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stackTop</a>--;</div>
<div class="line"><span class="lineno"> 57</span> <span class="keywordflow">return</span> operand;</div>
<div class="line"><span class="lineno"> 58</span>}</div>
<div class="ttc" id="aclassstack_html_aefb3dac828e32b4ec014ff4b5d43a6b8"><div class="ttname"><a href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stack::stackTop</a></div><div class="ttdeci">std::shared_ptr&lt; Node&lt; value_type &gt; &gt; stackTop</div><div class="ttdef"><b>Definition:</b> stack.hpp:75</div></div>
<div class="ttc" id="aclassstack_html_aefb3dac828e32b4ec014ff4b5d43a6b8"><div class="ttname"><a href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stack::stackTop</a></div><div class="ttdeci">std::shared_ptr&lt; Node&lt; value_type &gt; &gt; stackTop</div><div class="ttdef"><b>Definition</b> stack.hpp:75</div></div>
</div><!-- fragment -->
</div>
</div>
@@ -423,14 +419,13 @@ template&lt;<a class="elRef" target="_blank" href="http://en.cppreference.com/w/
<div class="line"><span class="lineno"> 135</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.stack[<a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_variable" href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stackTop</a>];</div>
<div class="line"><span class="lineno"> 136</span>}</div>
<div class="ttc" id="abasic_string_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string.html">std::string</a></div></div>
<div class="ttc" id="amemory__game_8cpp_html_a33167bb9cce6d527b478b4f6ae8c3f59"><div class="ttname"><a href="../../dd/d92/memory__game_8cpp.html#a33167bb9cce6d527b478b4f6ae8c3f59">games::memory_game::is_number</a></div><div class="ttdeci">bool is_number(const T &amp;input)</div><div class="ttdoc">Utility function to verify if the given input is a number or not. This is very useful to prevent the ...</div><div class="ttdef"><b>Definition:</b> memory_game.cpp:62</div></div>
<div class="ttc" id="apostfix__evaluation_8cpp_html_a59fd597e0ea394abe027ced4d2ea3338"><div class="ttname"><a href="../../d7/d75/postfix__evaluation_8cpp.html#a59fd597e0ea394abe027ced4d2ea3338">others::postfix_expression::evaluate</a></div><div class="ttdeci">void evaluate(float a, float b, const std::string &amp;operation, Stack *stack)</div><div class="ttdoc">Evaluate answer using given last two operands from and operation.</div><div class="ttdef"><b>Definition:</b> postfix_evaluation.cpp:77</div></div>
<div class="ttc" id="amemory__game_8cpp_html_a33167bb9cce6d527b478b4f6ae8c3f59"><div class="ttname"><a href="../../dd/d92/memory__game_8cpp.html#a33167bb9cce6d527b478b4f6ae8c3f59">games::memory_game::is_number</a></div><div class="ttdeci">bool is_number(const T &amp;input)</div><div class="ttdoc">Utility function to verify if the given input is a number or not. This is very useful to prevent the ...</div><div class="ttdef"><b>Definition</b> memory_game.cpp:62</div></div>
<div class="ttc" id="apostfix__evaluation_8cpp_html_a59fd597e0ea394abe027ced4d2ea3338"><div class="ttname"><a href="../../d7/d75/postfix__evaluation_8cpp.html#a59fd597e0ea394abe027ced4d2ea3338">others::postfix_expression::evaluate</a></div><div class="ttdeci">void evaluate(float a, float b, const std::string &amp;operation, Stack *stack)</div><div class="ttdoc">Evaluate answer using given last two operands from and operation.</div><div class="ttdef"><b>Definition</b> postfix_evaluation.cpp:77</div></div>
<div class="ttc" id="astof_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/string/basic_string/stof.html">std::stof</a></div><div class="ttdeci">T stof(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="../../d7/d75/postfix__evaluation_8cpp_ae38bd3a177a6d61da3859a281233bbe1_cgraph.svg" width="630" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d7/d75/postfix__evaluation_8cpp_ae38bd3a177a6d61da3859a281233bbe1_cgraph.svg" width="630" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
</div>
</div>
@@ -510,7 +505,7 @@ Here is the call graph for this function:</div>
<div class="line"><span class="lineno"> 151</span> assert(answer == -4);</div>
<div class="line"><span class="lineno"> 152</span>}</div>
<div class="ttc" id="aarray_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/array.html">std::array</a></div></div>
<div class="ttc" id="apostfix__evaluation_8cpp_html_ae38bd3a177a6d61da3859a281233bbe1"><div class="ttname"><a href="../../d7/d75/postfix__evaluation_8cpp.html#ae38bd3a177a6d61da3859a281233bbe1">others::postfix_expression::postfix_evaluation</a></div><div class="ttdeci">float postfix_evaluation(std::array&lt; std::string, N &gt; input)</div><div class="ttdoc">Postfix Evaluation algorithm to compute the value from given input array.</div><div class="ttdef"><b>Definition:</b> postfix_evaluation.cpp:115</div></div>
<div class="ttc" id="apostfix__evaluation_8cpp_html_ae38bd3a177a6d61da3859a281233bbe1"><div class="ttname"><a href="../../d7/d75/postfix__evaluation_8cpp.html#ae38bd3a177a6d61da3859a281233bbe1">others::postfix_expression::postfix_evaluation</a></div><div class="ttdeci">float postfix_evaluation(std::array&lt; std::string, N &gt; input)</div><div class="ttdoc">Postfix Evaluation algorithm to compute the value from given input array.</div><div class="ttdef"><b>Definition</b> postfix_evaluation.cpp:115</div></div>
</div><!-- fragment -->
</div>
</div>
@@ -555,7 +550,7 @@ Here is the call graph for this function:</div>
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="../../dir_9510827d0b234b3cc54b29892f217477.html">others</a></li><li class="navelem"><a class="el" href="../../d7/d75/postfix__evaluation_8cpp.html">postfix_evaluation.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.6 </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.7 </li>
</ul>
</div>
</body>