mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-03-21 04:18:34 +08:00
Documentation for 07663b019b
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
<map id="others/postfix_evaluation.cpp" name="others/postfix_evaluation.cpp">
|
||||
<area shape="rect" id="Node000001" title="Evaluation of Postfix Expression" alt="" coords="160,5,352,31"/>
|
||||
<area shape="rect" id="Node000001" title="Evaluation of Postfix Expression" alt="" coords="175,5,366,31"/>
|
||||
<area shape="rect" id="Node000002" title=" " alt="" coords="5,79,80,105"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="220,34,94,76,92,71,219,29"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="104,79,154,105"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="236,34,165,73,163,69,233,29"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="178,79,243,105"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="251,33,228,67,224,64,246,30"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="267,79,338,105"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="266,30,289,64,284,67,261,33"/>
|
||||
<area shape="rect" id="Node000006" title=" " alt="" coords="362,79,416,105"/>
|
||||
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="280,29,354,69,352,74,277,34"/>
|
||||
<area shape="rect" id="Node000007" title=" " alt="" coords="440,79,493,105"/>
|
||||
<area shape="poly" id="edge6_Node000001_Node000007" title=" " alt="" coords="292,29,426,74,424,79,291,34"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="233,34,96,77,94,72,231,29"/>
|
||||
<area shape="rect" id="Node000003" title=" " alt="" coords="104,79,168,105"/>
|
||||
<area shape="poly" id="edge2_Node000001_Node000003" title=" " alt="" coords="249,34,173,74,171,69,246,29"/>
|
||||
<area shape="rect" id="Node000004" title=" " alt="" coords="192,79,264,105"/>
|
||||
<area shape="poly" id="edge3_Node000001_Node000004" title=" " alt="" coords="266,33,245,67,241,64,261,30"/>
|
||||
<area shape="rect" id="Node000005" title=" " alt="" coords="288,79,341,105"/>
|
||||
<area shape="poly" id="edge4_Node000001_Node000005" title=" " alt="" coords="280,30,301,64,297,67,275,33"/>
|
||||
<area shape="rect" id="Node000006" title=" " alt="" coords="365,79,418,105"/>
|
||||
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="292,29,359,68,357,73,290,34"/>
|
||||
<area shape="rect" id="Node000007" title=" " alt="" coords="443,79,500,105"/>
|
||||
<area shape="poly" id="edge6_Node000001_Node000007" title=" " alt="" coords="306,29,429,73,428,78,304,34"/>
|
||||
</map>
|
||||
|
||||
@@ -1 +1 @@
|
||||
de5707406ee8a27095e1dcbe0a2a0239
|
||||
065f952c219db43861d43f31d5426619
|
||||
@@ -4,8 +4,8 @@
|
||||
<!-- Generated by graphviz version 13.1.2 (20250808.2320)
|
||||
-->
|
||||
<!-- Title: others/postfix_evaluation.cpp Pages: 1 -->
|
||||
<svg width="374pt" height="83pt"
|
||||
viewBox="0.00 0.00 374.00 83.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="379pt" height="83pt"
|
||||
viewBox="0.00 0.00 379.00 83.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Evaluation of Postfix Expression">
|
||||
<polygon fill="#999999" stroke="#666666" points="259.62,-74.5 116.12,-74.5 116.12,-55.25 259.62,-55.25 259.62,-74.5"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="187.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">others/postfix_evaluation.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="270.62,-74.5 127.12,-74.5 127.12,-55.25 270.62,-55.25 270.62,-74.5"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="198.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">others/postfix_evaluation.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -41,8 +41,8 @@
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M160.73,-54.84C134.64,-46.16 94.98,-32.96 65.78,-23.24"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="67.18,-20.02 56.59,-20.18 64.97,-26.66 67.18,-20.02"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M169.87,-54.84C141.61,-46.04 98.44,-32.6 67.12,-22.85"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="68.2,-19.52 57.62,-19.89 66.12,-26.2 68.2,-19.52"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -50,8 +50,8 @@
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="111.75,-19.25 74,-19.25 74,0 111.75,0 111.75,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="92.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">array</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="122,-19.25 73.75,-19.25 73.75,0 122,0 122,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="97.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -59,8 +59,8 @@
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M171.76,-54.84C157.29,-46.73 135.8,-34.68 118.89,-25.21"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="120.82,-22.28 110.39,-20.44 117.4,-28.39 120.82,-22.28"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M181.74,-54.84C166.22,-46.66 143.07,-34.46 125.03,-24.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="126.91,-21.98 116.43,-20.41 123.64,-28.17 126.91,-21.98"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -68,8 +68,8 @@
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="178,-19.25 129.75,-19.25 129.75,0 178,0 178,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="153.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="193.62,-19.25 140.12,-19.25 140.12,0 193.62,0 193.62,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="166.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -77,8 +77,8 @@
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M182.26,-55.08C177.76,-48.03 171.29,-37.9 165.66,-29.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="168.76,-27.43 160.43,-20.88 162.86,-31.2 168.76,-27.43"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M193.59,-55.08C189.4,-48.11 183.4,-38.12 178.14,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="181.2,-27.68 173.05,-20.91 175.2,-31.28 181.2,-27.68"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -86,8 +86,8 @@
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="249.62,-19.25 196.12,-19.25 196.12,0 249.62,0 249.62,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="222.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="251.88,-19.25 211.88,-19.25 211.88,0 251.88,0 251.88,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="231.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">stack</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -95,8 +95,8 @@
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M193.65,-55.08C198.29,-48.03 204.95,-37.9 210.74,-29.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="213.57,-31.15 216.14,-20.87 207.72,-27.31 213.57,-31.15"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M204.32,-55.08C208.65,-48.11 214.84,-38.12 220.26,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="223.22,-31.24 225.51,-20.9 217.27,-27.55 223.22,-31.24"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -104,8 +104,8 @@
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="307.88,-19.25 267.88,-19.25 267.88,0 307.88,0 307.88,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="287.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">stack</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="309.88,-19.25 269.88,-19.25 269.88,0 309.88,0 309.88,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="289.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">string</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -113,8 +113,8 @@
|
||||
<g id="edge5_Node000001_Node000006" class="edge">
|
||||
<title>Node1->Node6</title>
|
||||
<g id="a_edge5_Node000001_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M204.84,-54.84C220.14,-46.69 242.91,-34.57 260.74,-25.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="262.31,-28.2 269.49,-20.41 259.02,-22.02 262.31,-28.2"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M214.31,-54.84C228.04,-46.81 248.37,-34.91 264.49,-25.48"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="266.19,-28.54 273.06,-20.47 262.66,-22.5 266.19,-28.54"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -122,8 +122,8 @@
|
||||
<g id="Node000007" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_Node000007"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="365.88,-19.25 325.88,-19.25 325.88,0 365.88,0 365.88,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="345.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">string</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="371.38,-19.25 328.38,-19.25 328.38,0 371.38,0 371.38,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="349.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -131,8 +131,8 @@
|
||||
<g id="edge6_Node000001_Node000007" class="edge">
|
||||
<title>Node1->Node7</title>
|
||||
<g id="a_edge6_Node000001_Node000007"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M214.68,-54.84C242.35,-45.52 285.48,-30.98 314.67,-21.14"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="315.69,-24.49 324.05,-17.98 313.46,-17.86 315.69,-24.49"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M224.49,-54.84C250.08,-45.82 289.5,-31.92 317.3,-22.11"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="318.37,-25.45 326.63,-18.82 316.04,-18.85 318.37,-25.45"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
@@ -4,16 +4,16 @@
|
||||
<!-- Generated by graphviz version 13.1.2 (20250808.2320)
|
||||
-->
|
||||
<!-- Title: others/postfix_evaluation.cpp Pages: 1 -->
|
||||
<svg width="374pt" height="83pt"
|
||||
viewBox="0.00 0.00 374.00 83.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<svg width="379pt" height="83pt"
|
||||
viewBox="0.00 0.00 379.00 83.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 78.5)">
|
||||
<title>others/postfix_evaluation.cpp</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Evaluation of Postfix Expression">
|
||||
<polygon fill="#999999" stroke="#666666" points="259.62,-74.5 116.12,-74.5 116.12,-55.25 259.62,-55.25 259.62,-74.5"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="187.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">others/postfix_evaluation.cpp</text>
|
||||
<polygon fill="#999999" stroke="#666666" points="270.62,-74.5 127.12,-74.5 127.12,-55.25 270.62,-55.25 270.62,-74.5"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="198.88" y="-61" font-family="Helvetica,sans-Serif" font-size="10.00">others/postfix_evaluation.cpp</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -30,8 +30,8 @@
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M160.73,-54.84C134.64,-46.16 94.98,-32.96 65.78,-23.24"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="67.18,-20.02 56.59,-20.18 64.97,-26.66 67.18,-20.02"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M169.87,-54.84C141.61,-46.04 98.44,-32.6 67.12,-22.85"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="68.2,-19.52 57.62,-19.89 66.12,-26.2 68.2,-19.52"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -39,8 +39,8 @@
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="111.75,-19.25 74,-19.25 74,0 111.75,0 111.75,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="92.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">array</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="122,-19.25 73.75,-19.25 73.75,0 122,0 122,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="97.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -48,8 +48,8 @@
|
||||
<g id="edge2_Node000001_Node000003" class="edge">
|
||||
<title>Node1->Node3</title>
|
||||
<g id="a_edge2_Node000001_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M171.76,-54.84C157.29,-46.73 135.8,-34.68 118.89,-25.21"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="120.82,-22.28 110.39,-20.44 117.4,-28.39 120.82,-22.28"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M181.74,-54.84C166.22,-46.66 143.07,-34.46 125.03,-24.94"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="126.91,-21.98 116.43,-20.41 123.64,-28.17 126.91,-21.98"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -57,8 +57,8 @@
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="178,-19.25 129.75,-19.25 129.75,0 178,0 178,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="153.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">cassert</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="193.62,-19.25 140.12,-19.25 140.12,0 193.62,0 193.62,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="166.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -66,8 +66,8 @@
|
||||
<g id="edge3_Node000001_Node000004" class="edge">
|
||||
<title>Node1->Node4</title>
|
||||
<g id="a_edge3_Node000001_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M182.26,-55.08C177.76,-48.03 171.29,-37.9 165.66,-29.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="168.76,-27.43 160.43,-20.88 162.86,-31.2 168.76,-27.43"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M193.59,-55.08C189.4,-48.11 183.4,-38.12 178.14,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="181.2,-27.68 173.05,-20.91 175.2,-31.28 181.2,-27.68"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -75,8 +75,8 @@
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="249.62,-19.25 196.12,-19.25 196.12,0 249.62,0 249.62,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="222.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">iostream</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="251.88,-19.25 211.88,-19.25 211.88,0 251.88,0 251.88,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="231.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">stack</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -84,8 +84,8 @@
|
||||
<g id="edge4_Node000001_Node000005" class="edge">
|
||||
<title>Node1->Node5</title>
|
||||
<g id="a_edge4_Node000001_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M193.65,-55.08C198.29,-48.03 204.95,-37.9 210.74,-29.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="213.57,-31.15 216.14,-20.87 207.72,-27.31 213.57,-31.15"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M204.32,-55.08C208.65,-48.11 214.84,-38.12 220.26,-29.37"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="223.22,-31.24 225.51,-20.9 217.27,-27.55 223.22,-31.24"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -93,8 +93,8 @@
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="307.88,-19.25 267.88,-19.25 267.88,0 307.88,0 307.88,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="287.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">stack</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="309.88,-19.25 269.88,-19.25 269.88,0 309.88,0 309.88,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="289.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">string</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -102,8 +102,8 @@
|
||||
<g id="edge5_Node000001_Node000006" class="edge">
|
||||
<title>Node1->Node6</title>
|
||||
<g id="a_edge5_Node000001_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M204.84,-54.84C220.14,-46.69 242.91,-34.57 260.74,-25.08"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="262.31,-28.2 269.49,-20.41 259.02,-22.02 262.31,-28.2"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M214.31,-54.84C228.04,-46.81 248.37,-34.91 264.49,-25.48"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="266.19,-28.54 273.06,-20.47 262.66,-22.5 266.19,-28.54"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -111,8 +111,8 @@
|
||||
<g id="Node000007" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_Node000007"><a xlink:title=" ">
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="365.88,-19.25 325.88,-19.25 325.88,0 365.88,0 365.88,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="345.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">string</text>
|
||||
<polygon fill="#e0e0e0" stroke="#999999" points="371.38,-19.25 328.38,-19.25 328.38,0 371.38,0 371.38,-19.25"/>
|
||||
<text xml:space="preserve" text-anchor="middle" x="349.88" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">vector</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
@@ -120,8 +120,8 @@
|
||||
<g id="edge6_Node000001_Node000007" class="edge">
|
||||
<title>Node1->Node7</title>
|
||||
<g id="a_edge6_Node000001_Node000007"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M214.68,-54.84C242.35,-45.52 285.48,-30.98 314.67,-21.14"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="315.69,-24.49 324.05,-17.98 313.46,-17.86 315.69,-24.49"/>
|
||||
<path fill="none" stroke="#63b8ff" d="M224.49,-54.84C250.08,-45.82 289.5,-31.92 317.3,-22.11"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="318.37,-25.45 326.63,-18.82 316.04,-18.85 318.37,-25.45"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
|
||||
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
@@ -120,15 +120,15 @@ $(function(){initNavTree('d7/d75/postfix__evaluation_8cpp.html','../../',''); })
|
||||
<p>Evaluation of <a href="https://en.wikipedia.org/wiki/Reverse_Polish_notation" target="_blank">Postfix Expression</a>
|
||||
<a href="#details">More...</a></p>
|
||||
<div class="textblock"><code>#include <algorithm></code><br />
|
||||
<code>#include <array></code><br />
|
||||
<code>#include <cassert></code><br />
|
||||
<code>#include <iostream></code><br />
|
||||
<code>#include <stack></code><br />
|
||||
<code>#include <string></code><br />
|
||||
<code>#include <vector></code><br />
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
Include dependency graph for postfix_evaluation.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" loading="lazy" frameborder="0" src="../../d5/dc8/postfix__evaluation_8cpp__incl.svg" width="499" 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" loading="lazy" frameborder="0" src="../../d5/dc8/postfix__evaluation_8cpp__incl.svg" width="506" 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>
|
||||
<p><a href="../../d7/d75/postfix__evaluation_8cpp_source.html">Go to the source code of this file.</a></p>
|
||||
@@ -146,9 +146,8 @@ Functions</h2></td></tr>
|
||||
<tr class="memdesc:a4c27f949c9d6659be9f5bd2ccbe1360a"><td class="mdescLeft"> </td><td class="mdescRight">Checks if scanned string is a number. <br /></td></tr>
|
||||
<tr class="memitem:a19d995518723c1bc69718c3c33381e30" id="r_a19d995518723c1bc69718c3c33381e30"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a19d995518723c1bc69718c3c33381e30">others::postfix_expression::evaluate</a> (float a, float b, const std::string &operation, std::stack< float > &<a class="el" href="../../d1/dc2/classstack.html">stack</a>)</td></tr>
|
||||
<tr class="memdesc:a19d995518723c1bc69718c3c33381e30"><td class="mdescLeft"> </td><td class="mdescRight">Evaluate answer using given last two operands from and operation. <br /></td></tr>
|
||||
<tr class="memitem:ae38bd3a177a6d61da3859a281233bbe1" id="r_ae38bd3a177a6d61da3859a281233bbe1"><td class="memTemplParams" colspan="2">template<std::size_t N> </td></tr>
|
||||
<tr class="memitem:ae38bd3a177a6d61da3859a281233bbe1 template"><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="#ae38bd3a177a6d61da3859a281233bbe1">others::postfix_expression::postfix_evaluation</a> (std::array< std::string, N > input)</td></tr>
|
||||
<tr class="memdesc:ae38bd3a177a6d61da3859a281233bbe1"><td class="mdescLeft"> </td><td class="mdescRight">Postfix Evaluation algorithm to compute the value from given input array. <br /></td></tr>
|
||||
<tr class="memitem:a55fe33d236f61f7a87548f031418bfa0" id="r_a55fe33d236f61f7a87548f031418bfa0"><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="#a55fe33d236f61f7a87548f031418bfa0">others::postfix_expression::postfix_evaluation</a> (const std::vector< std::string > &input)</td></tr>
|
||||
<tr class="memdesc:a55fe33d236f61f7a87548f031418bfa0"><td class="mdescLeft"> </td><td class="mdescRight">Postfix Evaluation algorithm to compute the value from given input array. <br /></td></tr>
|
||||
<tr class="memitem:a6a8eeb7d346d5cd6335d9780fb7c0f15" id="r_a6a8eeb7d346d5cd6335d9780fb7c0f15"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a6a8eeb7d346d5cd6335d9780fb7c0f15">test_function_1</a> ()</td></tr>
|
||||
<tr class="memdesc:a6a8eeb7d346d5cd6335d9780fb7c0f15"><td class="mdescLeft"> </td><td class="mdescRight">Test function 1 with input array {'2', '3', '1', '*', '+', '9', '-'}. <br /></td></tr>
|
||||
<tr class="memitem:a5b97d12e8b61484f756a8721992bfae1" id="r_a5b97d12e8b61484f756a8721992bfae1"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="#a5b97d12e8b61484f756a8721992bfae1">test_function_2</a> ()</td></tr>
|
||||
@@ -289,78 +288,67 @@ Functions</h2></td></tr>
|
||||
<p>Main function. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html#l00156">156</a> of file <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html">postfix_evaluation.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 156</span> {</div>
|
||||
<div class="line"><span class="lineno"> 157</span> <a class="code hl_function" href="#a6a8eeb7d346d5cd6335d9780fb7c0f15">test_function_1</a>();</div>
|
||||
<div class="line"><span class="lineno"> 158</span> <a class="code hl_function" href="#a5b97d12e8b61484f756a8721992bfae1">test_function_2</a>();</div>
|
||||
<div class="line"><span class="lineno"> 159</span> test_function_3();</div>
|
||||
<div class="line"><span class="lineno"> 160</span> </div>
|
||||
<div class="line"><span class="lineno"> 161</span> std::cout << <span class="stringliteral">"\nTest implementations passed!\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 162</span> </div>
|
||||
<div class="line"><span class="lineno"> 163</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 164</span>}</div>
|
||||
<div class="ttc" id="apostfix__evaluation_8cpp_html_a5b97d12e8b61484f756a8721992bfae1"><div class="ttname"><a href="#a5b97d12e8b61484f756a8721992bfae1">test_function_2</a></div><div class="ttdeci">static void test_function_2()</div><div class="ttdoc">Test function 2 with input array {'100', '200', '+', '2', '/', '5', '*', '7', '+'}...</div><div class="ttdef"><b>Definition</b> <a href="../../d7/d75/postfix__evaluation_8cpp_source.html#l00133">postfix_evaluation.cpp:133</a></div></div>
|
||||
<div class="ttc" id="apostfix__evaluation_8cpp_html_a6a8eeb7d346d5cd6335d9780fb7c0f15"><div class="ttname"><a href="#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> <a href="../../d7/d75/postfix__evaluation_8cpp_source.html#l00120">postfix_evaluation.cpp:120</a></div></div>
|
||||
<p class="definition">Definition at line <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html#l00151">151</a> of file <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html">postfix_evaluation.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 151</span> {</div>
|
||||
<div class="line"><span class="lineno"> 152</span> <a class="code hl_function" href="#a6a8eeb7d346d5cd6335d9780fb7c0f15">test_function_1</a>();</div>
|
||||
<div class="line"><span class="lineno"> 153</span> <a class="code hl_function" href="#a5b97d12e8b61484f756a8721992bfae1">test_function_2</a>();</div>
|
||||
<div class="line"><span class="lineno"> 154</span> test_function_3();</div>
|
||||
<div class="line"><span class="lineno"> 155</span> </div>
|
||||
<div class="line"><span class="lineno"> 156</span> std::cout << <span class="stringliteral">"\nTest implementations passed!\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 157</span> </div>
|
||||
<div class="line"><span class="lineno"> 158</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 159</span>}</div>
|
||||
<div class="ttc" id="apostfix__evaluation_8cpp_html_a5b97d12e8b61484f756a8721992bfae1"><div class="ttname"><a href="#a5b97d12e8b61484f756a8721992bfae1">test_function_2</a></div><div class="ttdeci">static void test_function_2()</div><div class="ttdoc">Test function 2 with input array {'100', '200', '+', '2', '/', '5', '*', '7', '+'}...</div><div class="ttdef"><b>Definition</b> <a href="../../d7/d75/postfix__evaluation_8cpp_source.html#l00128">postfix_evaluation.cpp:128</a></div></div>
|
||||
<div class="ttc" id="apostfix__evaluation_8cpp_html_a6a8eeb7d346d5cd6335d9780fb7c0f15"><div class="ttname"><a href="#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> <a href="../../d7/d75/postfix__evaluation_8cpp_source.html#l00115">postfix_evaluation.cpp:115</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="ae38bd3a177a6d61da3859a281233bbe1" name="ae38bd3a177a6d61da3859a281233bbe1"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ae38bd3a177a6d61da3859a281233bbe1">◆ </a></span>postfix_evaluation()</h2>
|
||||
<a id="a55fe33d236f61f7a87548f031418bfa0" name="a55fe33d236f61f7a87548f031418bfa0"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a55fe33d236f61f7a87548f031418bfa0">◆ </a></span>postfix_evaluation()</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<div class="memtemplate">
|
||||
template<std::size_t N> </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">float others::postfix_expression::postfix_evaluation </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">std::array< std::string, N ></td> <td class="paramname"><span class="paramname"><em>input</em></span></td><td>)</td>
|
||||
<td class="paramtype">const std::vector< std::string > &</td> <td class="paramname"><span class="paramname"><em>input</em></span></td><td>)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Postfix Evaluation algorithm to compute the value from given input array. </p>
|
||||
<dl class="tparams"><dt>Template Parameters</dt><dd>
|
||||
<table class="tparams">
|
||||
<tr><td class="paramname">N</td><td>number of array size </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">input</td><td>Array of characters consisting of numbers and operations </td></tr>
|
||||
<tr><td class="paramname">input</td><td>vector of strings consisting of numbers and operations </td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>stack[stackTop] returns the top value from the stack </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html#l00088">88</a> of file <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html">postfix_evaluation.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 88</span> {</div>
|
||||
<div class="line"><span class="lineno"> 89</span> std::stack<float> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>;</div>
|
||||
<div class="line"><span class="lineno"> 90</span> <span class="keywordtype">int</span> j = 0;</div>
|
||||
<div class="line"><span class="lineno"> 91</span> </div>
|
||||
<div class="line"><span class="lineno"> 92</span> <span class="keywordflow">while</span> (j < N) {</div>
|
||||
<div class="line"><span class="lineno"> 93</span> std::string scan = input[j];</div>
|
||||
<div class="line"><span class="lineno"> 94</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="#a4c27f949c9d6659be9f5bd2ccbe1360a">is_number</a>(scan)) {</div>
|
||||
<div class="line"><span class="lineno"> 95</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d">push</a>(std::stof(scan));</div>
|
||||
<div class="line"><span class="lineno"> 96</span> </div>
|
||||
<div class="line"><span class="lineno"> 97</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 98</span> <span class="keyword">const</span> <span class="keywordtype">float</span> op2 = <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>();</div>
|
||||
<div class="line"><span class="lineno"> 99</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">pop</a>();</div>
|
||||
<div class="line"><span class="lineno"> 100</span> <span class="keyword">const</span> <span class="keywordtype">float</span> op1 = <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>();</div>
|
||||
<div class="line"><span class="lineno"> 101</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">pop</a>();</div>
|
||||
<p class="definition">Definition at line <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html#l00086">86</a> of file <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html">postfix_evaluation.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 86</span> {</div>
|
||||
<div class="line"><span class="lineno"> 87</span> std::stack<float> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>;</div>
|
||||
<div class="line"><span class="lineno"> 88</span> </div>
|
||||
<div class="line"><span class="lineno"> 89</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> &scan : input) {</div>
|
||||
<div class="line"><span class="lineno"> 90</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="#a4c27f949c9d6659be9f5bd2ccbe1360a">is_number</a>(scan)) {</div>
|
||||
<div class="line"><span class="lineno"> 91</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d">push</a>(std::stof(scan));</div>
|
||||
<div class="line"><span class="lineno"> 92</span> </div>
|
||||
<div class="line"><span class="lineno"> 93</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><span class="lineno"> 94</span> <span class="keyword">const</span> <span class="keywordtype">float</span> op2 = <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>();</div>
|
||||
<div class="line"><span class="lineno"> 95</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">pop</a>();</div>
|
||||
<div class="line"><span class="lineno"> 96</span> <span class="keyword">const</span> <span class="keywordtype">float</span> op1 = <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>();</div>
|
||||
<div class="line"><span class="lineno"> 97</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">pop</a>();</div>
|
||||
<div class="line"><span class="lineno"> 98</span> </div>
|
||||
<div class="line"><span class="lineno"> 99</span> evaluate(op1, op2, scan, <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>);</div>
|
||||
<div class="line"><span class="lineno"> 100</span> }</div>
|
||||
<div class="line"><span class="lineno"> 101</span> }</div>
|
||||
<div class="line"><span class="lineno"> 102</span> </div>
|
||||
<div class="line"><span class="lineno"> 103</span> evaluate(op1, op2, scan, <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>);</div>
|
||||
<div class="line"><span class="lineno"> 104</span> }</div>
|
||||
<div class="line"><span class="lineno"> 105</span> j++;</div>
|
||||
<div class="line"><span class="lineno"> 106</span> }</div>
|
||||
<div class="line"><span class="lineno"> 107</span> </div>
|
||||
<div class="line"><span class="lineno"> 108</span> std::cout << <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>() << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 109</span> </div>
|
||||
<div class="line"><span class="lineno"> 110</span> <span class="keywordflow">return</span> <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.top();</div>
|
||||
<div class="line"><span class="lineno"> 111</span>}</div>
|
||||
<div class="line"><span class="lineno"> 103</span> std::cout << <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>() << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><span class="lineno"> 104</span> </div>
|
||||
<div class="line"><span class="lineno"> 105</span> <span class="keywordflow">return</span> <a class="code hl_variable" href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a>.top();</div>
|
||||
<div class="line"><span class="lineno"> 106</span>}</div>
|
||||
<div class="ttc" id="aclassstack_html_a3647fb4418890f19e0dc414b8092b8b0"><div class="ttname"><a href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">stack::pop</a></div><div class="ttdeci">void pop()</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/stack_8hpp_source.html#l00062">stack.hpp:62</a></div></div>
|
||||
<div class="ttc" id="aclassstack_html_ae09630c4384903d187801921b2ddc709"><div class="ttname"><a href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">stack::top</a></div><div class="ttdeci">value_type top() const</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/stack_8hpp_source.html#l00056">stack.hpp:56</a></div></div>
|
||||
<div class="ttc" id="aparanthesis__matching_8cpp_html_aa37d24a036d239b3b528f13b9de880c7"><div class="ttname"><a href="../../dc/dc5/paranthesis__matching_8cpp.html#aa37d24a036d239b3b528f13b9de880c7">stack</a></div><div class="ttdeci">char stack[MAX]</div><div class="ttdef"><b>Definition</b> <a href="../../dc/dc5/paranthesis__matching_8cpp_source.html#l00020">paranthesis_matching.cpp:20</a></div></div>
|
||||
@@ -394,15 +382,15 @@ template<std::size_t N> </div>
|
||||
<p>Test function 1 with input array {'2', '3', '1', '*', '+', '9', '-'}. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>none </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html#l00120">120</a> of file <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html">postfix_evaluation.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 120</span> {</div>
|
||||
<div class="line"><span class="lineno"> 121</span> std::array<std::string, 7> input = {<span class="stringliteral">"2"</span>, <span class="stringliteral">"3"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"*"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"9"</span>, <span class="stringliteral">"-"</span>};</div>
|
||||
<div class="line"><span class="lineno"> 122</span> </div>
|
||||
<div class="line"><span class="lineno"> 123</span> <span class="keywordtype">float</span> answer = <a class="code hl_function" href="#ae38bd3a177a6d61da3859a281233bbe1">others::postfix_expression::postfix_evaluation</a>(input);</div>
|
||||
<div class="line"><span class="lineno"> 124</span> </div>
|
||||
<div class="line"><span class="lineno"> 125</span> assert(answer == -4);</div>
|
||||
<div class="line"><span class="lineno"> 126</span>}</div>
|
||||
<div class="ttc" id="apostfix__evaluation_8cpp_html_ae38bd3a177a6d61da3859a281233bbe1"><div class="ttname"><a href="#ae38bd3a177a6d61da3859a281233bbe1">others::postfix_expression::postfix_evaluation</a></div><div class="ttdeci">float postfix_evaluation(std::array< std::string, N > input)</div><div class="ttdoc">Postfix Evaluation algorithm to compute the value from given input array.</div><div class="ttdef"><b>Definition</b> <a href="../../d7/d75/postfix__evaluation_8cpp_source.html#l00088">postfix_evaluation.cpp:88</a></div></div>
|
||||
<p class="definition">Definition at line <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html#l00115">115</a> of file <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html">postfix_evaluation.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 115</span> {</div>
|
||||
<div class="line"><span class="lineno"> 116</span> std::vector<std::string> input = {<span class="stringliteral">"2"</span>, <span class="stringliteral">"3"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"*"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"9"</span>, <span class="stringliteral">"-"</span>};</div>
|
||||
<div class="line"><span class="lineno"> 117</span> </div>
|
||||
<div class="line"><span class="lineno"> 118</span> <span class="keywordtype">float</span> answer = <a class="code hl_function" href="#a55fe33d236f61f7a87548f031418bfa0">others::postfix_expression::postfix_evaluation</a>(input);</div>
|
||||
<div class="line"><span class="lineno"> 119</span> </div>
|
||||
<div class="line"><span class="lineno"> 120</span> assert(answer == -4);</div>
|
||||
<div class="line"><span class="lineno"> 121</span>}</div>
|
||||
<div class="ttc" id="apostfix__evaluation_8cpp_html_a55fe33d236f61f7a87548f031418bfa0"><div class="ttname"><a href="#a55fe33d236f61f7a87548f031418bfa0">others::postfix_expression::postfix_evaluation</a></div><div class="ttdeci">float postfix_evaluation(const std::vector< std::string > &input)</div><div class="ttdoc">Postfix Evaluation algorithm to compute the value from given input array.</div><div class="ttdef"><b>Definition</b> <a href="../../d7/d75/postfix__evaluation_8cpp_source.html#l00086">postfix_evaluation.cpp:86</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -432,14 +420,14 @@ template<std::size_t N> </div>
|
||||
<p>Test function 2 with input array {'100', '200', '+', '2', '/', '5', '*', '7', '+'}. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>none </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html#l00133">133</a> of file <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html">postfix_evaluation.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 133</span> {</div>
|
||||
<div class="line"><span class="lineno"> 134</span> std::array<std::string, 9> input = {<span class="stringliteral">"100"</span>, <span class="stringliteral">"200"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"2"</span>, <span class="stringliteral">"/"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 135</span> <span class="stringliteral">"5"</span>, <span class="stringliteral">"*"</span>, <span class="stringliteral">"7"</span>, <span class="stringliteral">"+"</span>};</div>
|
||||
<div class="line"><span class="lineno"> 136</span> <span class="keywordtype">float</span> answer = <a class="code hl_function" href="#ae38bd3a177a6d61da3859a281233bbe1">others::postfix_expression::postfix_evaluation</a>(input);</div>
|
||||
<div class="line"><span class="lineno"> 137</span> </div>
|
||||
<div class="line"><span class="lineno"> 138</span> assert(answer == 757);</div>
|
||||
<div class="line"><span class="lineno"> 139</span>}</div>
|
||||
<p class="definition">Definition at line <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html#l00128">128</a> of file <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html">postfix_evaluation.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 128</span> {</div>
|
||||
<div class="line"><span class="lineno"> 129</span> std::vector<std::string> input = {<span class="stringliteral">"100"</span>, <span class="stringliteral">"200"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"2"</span>, <span class="stringliteral">"/"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 130</span> <span class="stringliteral">"5"</span>, <span class="stringliteral">"*"</span>, <span class="stringliteral">"7"</span>, <span class="stringliteral">"+"</span>};</div>
|
||||
<div class="line"><span class="lineno"> 131</span> <span class="keywordtype">float</span> answer = <a class="code hl_function" href="#a55fe33d236f61f7a87548f031418bfa0">others::postfix_expression::postfix_evaluation</a>(input);</div>
|
||||
<div class="line"><span class="lineno"> 132</span> </div>
|
||||
<div class="line"><span class="lineno"> 133</span> assert(answer == 757);</div>
|
||||
<div class="line"><span class="lineno"> 134</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
@@ -466,17 +454,17 @@ template<std::size_t N> </div>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html#l00141">141</a> of file <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html">postfix_evaluation.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 141</span> {</div>
|
||||
<div class="line"><span class="lineno"> 142</span> std::array<std::string, 43> input = {</div>
|
||||
<div class="line"><span class="lineno"> 143</span> <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 144</span> <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 145</span> <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 146</span> <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>};</div>
|
||||
<div class="line"><span class="lineno"> 147</span> <span class="keywordtype">float</span> answer = <a class="code hl_function" href="#ae38bd3a177a6d61da3859a281233bbe1">others::postfix_expression::postfix_evaluation</a>(input);</div>
|
||||
<div class="line"><span class="lineno"> 148</span> </div>
|
||||
<div class="line"><span class="lineno"> 149</span> assert(answer == 22);</div>
|
||||
<div class="line"><span class="lineno"> 150</span>}</div>
|
||||
<p class="definition">Definition at line <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html#l00136">136</a> of file <a class="el" href="../../d7/d75/postfix__evaluation_8cpp_source.html">postfix_evaluation.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 136</span> {</div>
|
||||
<div class="line"><span class="lineno"> 137</span> std::vector<std::string> input = {</div>
|
||||
<div class="line"><span class="lineno"> 138</span> <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 139</span> <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 140</span> <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>,</div>
|
||||
<div class="line"><span class="lineno"> 141</span> <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>};</div>
|
||||
<div class="line"><span class="lineno"> 142</span> <span class="keywordtype">float</span> answer = <a class="code hl_function" href="#a55fe33d236f61f7a87548f031418bfa0">others::postfix_expression::postfix_evaluation</a>(input);</div>
|
||||
<div class="line"><span class="lineno"> 143</span> </div>
|
||||
<div class="line"><span class="lineno"> 144</span> assert(answer == 22);</div>
|
||||
<div class="line"><span class="lineno"> 145</span>}</div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@ var postfix__evaluation_8cpp =
|
||||
[ "others::postfix_expression::evaluate", "d7/d75/postfix__evaluation_8cpp.html#a19d995518723c1bc69718c3c33381e30", null ],
|
||||
[ "others::postfix_expression::is_number", "d7/d75/postfix__evaluation_8cpp.html#a4c27f949c9d6659be9f5bd2ccbe1360a", null ],
|
||||
[ "main", "d7/d75/postfix__evaluation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
|
||||
[ "others::postfix_expression::postfix_evaluation", "d7/d75/postfix__evaluation_8cpp.html#ae38bd3a177a6d61da3859a281233bbe1", null ],
|
||||
[ "others::postfix_expression::postfix_evaluation", "d7/d75/postfix__evaluation_8cpp.html#a55fe33d236f61f7a87548f031418bfa0", null ],
|
||||
[ "test_function_1", "d7/d75/postfix__evaluation_8cpp.html#a6a8eeb7d346d5cd6335d9780fb7c0f15", null ],
|
||||
[ "test_function_2", "d7/d75/postfix__evaluation_8cpp.html#a5b97d12e8b61484f756a8721992bfae1", null ]
|
||||
];
|
||||
@@ -118,11 +118,11 @@ $(function(){initNavTree('d7/d75/postfix__evaluation_8cpp_source.html','../../',
|
||||
<div class="contents">
|
||||
<a href="../../d7/d75/postfix__evaluation_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span></div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <algorithm></span> <span class="comment">// for all_of</span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <array></span> <span class="comment">// for array</span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <cassert></span> <span class="comment">// for assert</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include <iostream></span> <span class="comment">// for io operations</span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include <stack></span> <span class="comment">// for std::stack</span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include <string></span> <span class="comment">// for stof</span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <cassert></span> <span class="comment">// for assert</span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <iostream></span> <span class="comment">// for io operations</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include <stack></span> <span class="comment">// for std::stack</span></div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include <string></span> <span class="comment">// for stof</span></div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include <vector></span> <span class="comment">// for std::vector</span></div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span></div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d0/d6f/namespaceothers.html">others</a> {</div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="keyword">namespace </span><a class="code hl_namespace" href="../../d4/de6/namespacepostfix__expression.html">postfix_expression</a> {</div>
|
||||
@@ -166,77 +166,73 @@ $(function(){initNavTree('d7/d75/postfix__evaluation_8cpp_source.html','../../',
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span></div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span><span class="keyword">template</span> <std::<span class="keywordtype">size_t</span> N></div>
|
||||
<div class="foldopen" id="foldopen00088" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"><a class="line" href="../../d7/d75/postfix__evaluation_8cpp.html#ae38bd3a177a6d61da3859a281233bbe1"> 88</a></span><span class="keywordtype">float</span> <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#ae38bd3a177a6d61da3859a281233bbe1">postfix_evaluation</a>(std::array<std::string, N> input) {</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> std::stack<float> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>;</div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordtype">int</span> j = 0;</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> </div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="keywordflow">while</span> (j < N) {</div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> std::string scan = input[j];</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#a4c27f949c9d6659be9f5bd2ccbe1360a">is_number</a>(scan)) {</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d">push</a>(std::stof(scan));</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> </div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="keyword">const</span> <span class="keywordtype">float</span> op2 = <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>();</div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">pop</a>();</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keyword">const</span> <span class="keywordtype">float</span> op1 = <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>();</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">pop</a>();</div>
|
||||
<div class="foldopen" id="foldopen00086" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"><a class="line" href="../../d7/d75/postfix__evaluation_8cpp.html#a55fe33d236f61f7a87548f031418bfa0"> 86</a></span><span class="keywordtype">float</span> <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#a55fe33d236f61f7a87548f031418bfa0">postfix_evaluation</a>(<span class="keyword">const</span> std::vector<std::string> &input) {</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> std::stack<float> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>;</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> </div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> &scan : input) {</div>
|
||||
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#a4c27f949c9d6659be9f5bd2ccbe1360a">is_number</a>(scan)) {</div>
|
||||
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d">push</a>(std::stof(scan));</div>
|
||||
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> </div>
|
||||
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> } <span class="keywordflow">else</span> {</div>
|
||||
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> <span class="keyword">const</span> <span class="keywordtype">float</span> op2 = <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>();</div>
|
||||
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">pop</a>();</div>
|
||||
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> <span class="keyword">const</span> <span class="keywordtype">float</span> op1 = <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>();</div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">pop</a>();</div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> </div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#a19d995518723c1bc69718c3c33381e30">evaluate</a>(op1, op2, scan, <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>);</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> }</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> }</div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> </div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#a19d995518723c1bc69718c3c33381e30">evaluate</a>(op1, op2, scan, <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>);</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> }</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> j++;</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> }</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> </div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> std::cout << <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>() << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> </div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>();</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span>}</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> std::cout << <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>() << <span class="stringliteral">"\n"</span>;</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> </div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="keywordflow">return</span> <a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a>.<a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>();</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span>} <span class="comment">// namespace postfix_expression</span></div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span>} <span class="comment">// namespace others</span></div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span></div>
|
||||
<div class="foldopen" id="foldopen00120" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"><a class="line" href="../../d7/d75/postfix__evaluation_8cpp.html#a6a8eeb7d346d5cd6335d9780fb7c0f15"> 120</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#a6a8eeb7d346d5cd6335d9780fb7c0f15">test_function_1</a>() {</div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> std::array<std::string, 7> input = {<span class="stringliteral">"2"</span>, <span class="stringliteral">"3"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"*"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"9"</span>, <span class="stringliteral">"-"</span>};</div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> </div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keywordtype">float</span> answer = <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#ae38bd3a177a6d61da3859a281233bbe1">others::postfix_expression::postfix_evaluation</a>(input);</div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> </div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> assert(answer == -4);</div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span>}</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span>} <span class="comment">// namespace postfix_expression</span></div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span>} <span class="comment">// namespace others</span></div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span></div>
|
||||
<div class="foldopen" id="foldopen00115" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"><a class="line" href="../../d7/d75/postfix__evaluation_8cpp.html#a6a8eeb7d346d5cd6335d9780fb7c0f15"> 115</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#a6a8eeb7d346d5cd6335d9780fb7c0f15">test_function_1</a>() {</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> std::vector<std::string> input = {<span class="stringliteral">"2"</span>, <span class="stringliteral">"3"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"*"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"9"</span>, <span class="stringliteral">"-"</span>};</div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> </div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="keywordtype">float</span> answer = <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#a55fe33d236f61f7a87548f031418bfa0">others::postfix_expression::postfix_evaluation</a>(input);</div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> </div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> assert(answer == -4);</div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span></div>
|
||||
<div class="foldopen" id="foldopen00133" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"><a class="line" href="../../d7/d75/postfix__evaluation_8cpp.html#a5b97d12e8b61484f756a8721992bfae1"> 133</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#a5b97d12e8b61484f756a8721992bfae1">test_function_2</a>() {</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> std::array<std::string, 9> input = {<span class="stringliteral">"100"</span>, <span class="stringliteral">"200"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"2"</span>, <span class="stringliteral">"/"</span>,</div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="stringliteral">"5"</span>, <span class="stringliteral">"*"</span>, <span class="stringliteral">"7"</span>, <span class="stringliteral">"+"</span>};</div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <span class="keywordtype">float</span> answer = <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#ae38bd3a177a6d61da3859a281233bbe1">others::postfix_expression::postfix_evaluation</a>(input);</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> </div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> assert(answer == 757);</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span>}</div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span></div>
|
||||
<div class="foldopen" id="foldopen00128" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"><a class="line" href="../../d7/d75/postfix__evaluation_8cpp.html#a5b97d12e8b61484f756a8721992bfae1"> 128</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#a5b97d12e8b61484f756a8721992bfae1">test_function_2</a>() {</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> std::vector<std::string> input = {<span class="stringliteral">"100"</span>, <span class="stringliteral">"200"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"2"</span>, <span class="stringliteral">"/"</span>,</div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <span class="stringliteral">"5"</span>, <span class="stringliteral">"*"</span>, <span class="stringliteral">"7"</span>, <span class="stringliteral">"+"</span>};</div>
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <span class="keywordtype">float</span> answer = <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#a55fe33d236f61f7a87548f031418bfa0">others::postfix_expression::postfix_evaluation</a>(input);</div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> </div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> assert(answer == 757);</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> </div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span><span class="keyword">static</span> <span class="keywordtype">void</span> test_function_3() {</div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> std::array<std::string, 43> input = {</div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>,</div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>,</div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>,</div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>};</div>
|
||||
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> <span class="keywordtype">float</span> answer = <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#ae38bd3a177a6d61da3859a281233bbe1">others::postfix_expression::postfix_evaluation</a>(input);</div>
|
||||
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
|
||||
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> assert(answer == 22);</div>
|
||||
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span>}</div>
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span></div>
|
||||
<div class="foldopen" id="foldopen00156" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"><a class="line" href="../../d7/d75/postfix__evaluation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 156</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#a6a8eeb7d346d5cd6335d9780fb7c0f15">test_function_1</a>();</div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#a5b97d12e8b61484f756a8721992bfae1">test_function_2</a>();</div>
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> test_function_3();</div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> </div>
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> std::cout << <span class="stringliteral">"\nTest implementations passed!\n"</span>;</div>
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> </div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span>}</div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> </div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span><span class="keyword">static</span> <span class="keywordtype">void</span> test_function_3() {</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> std::vector<std::string> input = {</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>,</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>, <span class="stringliteral">"1"</span>,</div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>,</div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>, <span class="stringliteral">"+"</span>};</div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <span class="keywordtype">float</span> answer = <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#a55fe33d236f61f7a87548f031418bfa0">others::postfix_expression::postfix_evaluation</a>(input);</div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> </div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> assert(answer == 22);</div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span>}</div>
|
||||
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span></div>
|
||||
<div class="foldopen" id="foldopen00151" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"><a class="line" href="../../d7/d75/postfix__evaluation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 151</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#a6a8eeb7d346d5cd6335d9780fb7c0f15">test_function_1</a>();</div>
|
||||
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <a class="code hl_function" href="../../d7/d75/postfix__evaluation_8cpp.html#a5b97d12e8b61484f756a8721992bfae1">test_function_2</a>();</div>
|
||||
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> test_function_3();</div>
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> </div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> std::cout << <span class="stringliteral">"\nTest implementations passed!\n"</span>;</div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> </div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span>}</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> <a href="../../df/d47/stack_8hpp_source.html#l00019">stack.hpp:19</a></div></div>
|
||||
<div class="ttc" id="aclassstack_html_a3647fb4418890f19e0dc414b8092b8b0"><div class="ttname"><a href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">stack::pop</a></div><div class="ttdeci">void pop()</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/stack_8hpp_source.html#l00062">stack.hpp:62</a></div></div>
|
||||
@@ -246,10 +242,10 @@ $(function(){initNavTree('d7/d75/postfix__evaluation_8cpp_source.html','../../',
|
||||
<div class="ttc" id="anamespacepostfix__expression_html"><div class="ttname"><a href="../../d4/de6/namespacepostfix__expression.html">postfix_expression</a></div><div class="ttdoc">Functions for Postfix Expression algorithm.</div></div>
|
||||
<div class="ttc" id="apostfix__evaluation_8cpp_html_a19d995518723c1bc69718c3c33381e30"><div class="ttname"><a href="../../d7/d75/postfix__evaluation_8cpp.html#a19d995518723c1bc69718c3c33381e30">others::postfix_expression::evaluate</a></div><div class="ttdeci">void evaluate(float a, float b, const std::string &operation, std::stack< float > &stack)</div><div class="ttdoc">Evaluate answer using given last two operands from and operation.</div><div class="ttdef"><b>Definition</b> <a href="#l00049">postfix_evaluation.cpp:49</a></div></div>
|
||||
<div class="ttc" id="apostfix__evaluation_8cpp_html_a4c27f949c9d6659be9f5bd2ccbe1360a"><div class="ttname"><a href="../../d7/d75/postfix__evaluation_8cpp.html#a4c27f949c9d6659be9f5bd2ccbe1360a">others::postfix_expression::is_number</a></div><div class="ttdeci">bool is_number(const std::string &s)</div><div class="ttdoc">Checks if scanned string is a number.</div><div class="ttdef"><b>Definition</b> <a href="#l00037">postfix_evaluation.cpp:37</a></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 {'100', '200', '+', '2', '/', '5', '*', '7', '+'}...</div><div class="ttdef"><b>Definition</b> <a href="#l00133">postfix_evaluation.cpp:133</a></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> <a href="#l00120">postfix_evaluation.cpp:120</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< std::string, N > input)</div><div class="ttdoc">Postfix Evaluation algorithm to compute the value from given input array.</div><div class="ttdef"><b>Definition</b> <a href="#l00088">postfix_evaluation.cpp:88</a></div></div>
|
||||
<div class="ttc" id="apostfix__evaluation_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d7/d75/postfix__evaluation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">Main function.</div><div class="ttdef"><b>Definition</b> <a href="#l00156">postfix_evaluation.cpp:156</a></div></div>
|
||||
<div class="ttc" id="apostfix__evaluation_8cpp_html_a55fe33d236f61f7a87548f031418bfa0"><div class="ttname"><a href="../../d7/d75/postfix__evaluation_8cpp.html#a55fe33d236f61f7a87548f031418bfa0">others::postfix_expression::postfix_evaluation</a></div><div class="ttdeci">float postfix_evaluation(const std::vector< std::string > &input)</div><div class="ttdoc">Postfix Evaluation algorithm to compute the value from given input array.</div><div class="ttdef"><b>Definition</b> <a href="#l00086">postfix_evaluation.cpp:86</a></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 {'100', '200', '+', '2', '/', '5', '*', '7', '+'}...</div><div class="ttdef"><b>Definition</b> <a href="#l00128">postfix_evaluation.cpp:128</a></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> <a href="#l00115">postfix_evaluation.cpp:115</a></div></div>
|
||||
<div class="ttc" id="apostfix__evaluation_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../d7/d75/postfix__evaluation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">Main function.</div><div class="ttdef"><b>Definition</b> <a href="#l00151">postfix_evaluation.cpp:151</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
</div><!-- container -->
|
||||
|
||||
@@ -1484,9 +1484,9 @@
|
||||
<a href="d7/d75/postfix__evaluation_8cpp.html"/>
|
||||
<a href="d7/d75/postfix__evaluation_8cpp.html#a19d995518723c1bc69718c3c33381e30"/>
|
||||
<a href="d7/d75/postfix__evaluation_8cpp.html#a4c27f949c9d6659be9f5bd2ccbe1360a"/>
|
||||
<a href="d7/d75/postfix__evaluation_8cpp.html#a55fe33d236f61f7a87548f031418bfa0"/>
|
||||
<a href="d7/d75/postfix__evaluation_8cpp.html#a5b97d12e8b61484f756a8721992bfae1"/>
|
||||
<a href="d7/d75/postfix__evaluation_8cpp.html#a6a8eeb7d346d5cd6335d9780fb7c0f15"/>
|
||||
<a href="d7/d75/postfix__evaluation_8cpp.html#ae38bd3a177a6d61da3859a281233bbe1"/>
|
||||
<a href="d7/d75/postfix__evaluation_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"/>
|
||||
<a href="d7/d75/postfix__evaluation_8cpp_source.html"/>
|
||||
<a href="d7/d77/class_edge.html"/>
|
||||
|
||||
@@ -50,7 +50,7 @@ var searchData=
|
||||
['pop_5ffront_47',['pop_front',['../d8/d77/namespacemachine__learning.html#a912cf68863063a38d6e63545be5eb093',1,'machine_learning']]],
|
||||
['populate_5fparents_48',['populate_parents',['../d0/d58/classgraph_1_1_rooted_tree.html#ae6928f3ebd491541e9570e746b877c1e',1,'graph::RootedTree']]],
|
||||
['populate_5fup_49',['populate_up',['../d9/d23/classgraph_1_1_lowest_common_ancestor.html#a42589cc39d6bbff6c997152f1b96e356',1,'graph::LowestCommonAncestor']]],
|
||||
['postfix_5fevaluation_50',['postfix_evaluation',['../d7/d75/postfix__evaluation_8cpp.html#ae38bd3a177a6d61da3859a281233bbe1',1,'others::postfix_expression']]],
|
||||
['postfix_5fevaluation_50',['postfix_evaluation',['../d7/d75/postfix__evaluation_8cpp.html#a55fe33d236f61f7a87548f031418bfa0',1,'others::postfix_expression']]],
|
||||
['postfix_5fevaluation_2ecpp_51',['postfix_evaluation.cpp',['../d7/d75/postfix__evaluation_8cpp.html',1,'']]],
|
||||
['postfix_5fexpression_52',['postfix_expression',['../d4/de6/namespacepostfix__expression.html',1,'']]],
|
||||
['postorder_53',['postorder',['../dd/de1/classothers_1_1recursive__tree__traversals_1_1_b_t.html#ac9404b65f407f631915515fa2e08a40c',1,'others::recursive_tree_traversals::BT']]],
|
||||
|
||||
@@ -21,7 +21,7 @@ var searchData=
|
||||
['pop_5ffront_18',['pop_front',['../d8/d77/namespacemachine__learning.html#a912cf68863063a38d6e63545be5eb093',1,'machine_learning']]],
|
||||
['populate_5fparents_19',['populate_parents',['../d0/d58/classgraph_1_1_rooted_tree.html#ae6928f3ebd491541e9570e746b877c1e',1,'graph::RootedTree']]],
|
||||
['populate_5fup_20',['populate_up',['../d9/d23/classgraph_1_1_lowest_common_ancestor.html#a42589cc39d6bbff6c997152f1b96e356',1,'graph::LowestCommonAncestor']]],
|
||||
['postfix_5fevaluation_21',['postfix_evaluation',['../d7/d75/postfix__evaluation_8cpp.html#ae38bd3a177a6d61da3859a281233bbe1',1,'others::postfix_expression']]],
|
||||
['postfix_5fevaluation_21',['postfix_evaluation',['../d7/d75/postfix__evaluation_8cpp.html#a55fe33d236f61f7a87548f031418bfa0',1,'others::postfix_expression']]],
|
||||
['postorder_22',['postorder',['../dd/de1/classothers_1_1recursive__tree__traversals_1_1_b_t.html#ac9404b65f407f631915515fa2e08a40c',1,'others::recursive_tree_traversals::BT']]],
|
||||
['postorderiterative_23',['postOrderIterative',['../d9/d12/classothers_1_1iterative__tree__traversals_1_1_binary_tree.html#a636a07c90b7f312bb86d2ec104efca25',1,'others::iterative_tree_traversals::BinaryTree']]],
|
||||
['power_24',['power',['../de/dc3/fibonacci__sum_8cpp.html#a7cf5feaf168b88e74544da59ed830311',1,'math::fibonacci_sum::power()'],['../df/d72/modular__division_8cpp.html#a66cdf93153cbd1408bd74ac68961d179',1,'math::modular_division::power()'],['../dd/d47/namespacemath.html#afcd07701d73ed65cd616bcba02737f3d',1,'math::power()'],['../df/def/power__for__huge__numbers_8cpp.html#ae249a2af508aa94266023ce8aa81426f',1,'power(int x, int n): power_for_huge_numbers.cpp'],['../d7/d35/matrix__exponentiation_8cpp.html#a702a9fc90e79b05b863cc4efa26ae2ec',1,'power(const vector< vector< ll > > &A, ll p): matrix_exponentiation.cpp']]],
|
||||
|
||||
Reference in New Issue
Block a user