<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=SE250%3Alab-8%3Aaomr001</id>
	<title>SE250:lab-8:aomr001 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kram.nz/index.php?action=history&amp;feed=atom&amp;title=SE250%3Alab-8%3Aaomr001"/>
	<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:lab-8:aomr001&amp;action=history"/>
	<updated>2026-04-28T12:14:28Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.kram.nz/index.php?title=SE250:lab-8:aomr001&amp;diff=8050&amp;oldid=prev</id>
		<title>Mark: 4 revision(s)</title>
		<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:lab-8:aomr001&amp;diff=8050&amp;oldid=prev"/>
		<updated>2008-11-03T05:20:25Z</updated>

		<summary type="html">&lt;p&gt;4 revision(s)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;at the start i was really stuck trying to compile the code .. &lt;br /&gt;
as it had some unexpected errors .. i had to ask the tutor who told me to &lt;br /&gt;
move the function &amp;quot;error&amp;quot; higher up on the code .. and change the function name &amp;quot;strcmip&amp;quot; to strcmp &lt;br /&gt;
which fixed the compilation problems .. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== task2 == &lt;br /&gt;
we were asked to write a mkNode function for the expression -(-(a b )) &lt;br /&gt;
i have done that using the code : &lt;br /&gt;
&amp;lt;pre&amp;gt;ParseTree* t = mkNode( &amp;#039;-&amp;#039;, mkNode(&amp;#039;-&amp;#039;, mkNode( &amp;#039;a&amp;#039;, 0 ),mkNode(&amp;#039;b&amp;#039;,0),0),0 );&lt;br /&gt;
prefix_tree(t);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
the output was: &lt;br /&gt;
&amp;lt;pre&amp;gt;-(-(a b)) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== task3 ==&lt;br /&gt;
we were asked to make an expression&lt;br /&gt;
?(&amp;gt;(+(a b) c) *(z +(y b)) ?(=(a 2) -(x y) -(y x)))&lt;br /&gt;
&lt;br /&gt;
code:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ParseTree* branch1 = mkNode(&amp;#039;&amp;gt;&amp;#039;,mkNode(&amp;#039;+&amp;#039;,mkNode(&amp;#039;a&amp;#039;,0),mkNode(&amp;#039;b&amp;#039;,0),0),mkNode(&amp;#039;c&amp;#039;,0),0) ;&lt;br /&gt;
    ParseTree* branch2 = mkNode(&amp;#039;*&amp;#039;,mkNode(&amp;#039;z&amp;#039;,0),mkNode(&amp;#039;+&amp;#039;,mkNode(&amp;#039;y&amp;#039;,0),mkNode(&amp;#039;b&amp;#039;,0),0),0); ;&lt;br /&gt;
    ParseTree* branch3 = mkNode(&amp;#039;?&amp;#039;,mkNode(&amp;#039;=&amp;#039;,mkNode(&amp;#039;a&amp;#039;,0),mkNode(&amp;#039;2&amp;#039;,0),0),mkNode(&amp;#039;-&amp;#039;,mkNode(&amp;#039;x&amp;#039;,0),mkNode(&amp;#039;y&amp;#039;,0),0),mkNode(&amp;#039;-&amp;#039;,mkNode(&amp;#039;y&amp;#039;,0),mkNode(&amp;#039;x&amp;#039;,0),0),0);&lt;br /&gt;
    ParseTree* final = mkNode(&amp;#039;?&amp;#039;,branch1,branch2,branch3) ;&lt;br /&gt;
&lt;br /&gt;
    prefix_tree(final);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
output:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
?(&amp;gt;(+(a b) c) *(z +(y b)) ?(=(a 2) -(x y) -(y x)))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== task4 ==&lt;br /&gt;
we were then asked to draw the tree .. then graph it and compare between the 2 .. &lt;br /&gt;
in my case .. my expectations on the shape of the parse tree ., was the same as the graph given when using&lt;br /&gt;
tree_to_graph function&lt;br /&gt;
&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;img src=&amp;quot;http://aamranovich.googlepages.com/graphictask1.jpg&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== task5 == &lt;br /&gt;
the colon &amp;quot;:&amp;quot; is used in C to distinguish and separate different conditions.. &lt;br /&gt;
the parse tree doesn&amp;#039;t need to use that because the different conditions are in different branches of the parse tree.&lt;/div&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
</feed>