<?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-7%3Ahpan027</id>
	<title>SE250:lab-7:hpan027 - 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-7%3Ahpan027"/>
	<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:lab-7:hpan027&amp;action=history"/>
	<updated>2026-04-28T21:21:42Z</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-7:hpan027&amp;diff=7621&amp;oldid=prev</id>
		<title>Mark: 19 revision(s)</title>
		<link rel="alternate" type="text/html" href="https://wiki.kram.nz/index.php?title=SE250:lab-7:hpan027&amp;diff=7621&amp;oldid=prev"/>
		<updated>2008-11-03T05:20:15Z</updated>

		<summary type="html">&lt;p&gt;19 revision(s)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Initial problem ==&lt;br /&gt;
&lt;br /&gt;
The write command did not work. Possibly due to the graphviz package not being installed on the lab computers. Had to go to their website to download the programme and manually convert the .dot files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Balanced tree ==&lt;br /&gt;
&lt;br /&gt;
http://studwww.cs.auckland.ac.nz/~hpan027/250-7-1.jpg&lt;br /&gt;
&lt;br /&gt;
Input order: d b e a c f g&lt;br /&gt;
&lt;br /&gt;
*The order only matters by level - the tree will still remain perfectly ordered if you shuffle the order within levels (e.g. d f b e c a g)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Rotating a skewed tree ==&lt;br /&gt;
&lt;br /&gt;
Pre-rotation: &lt;br /&gt;
&lt;br /&gt;
http://studwww.cs.auckland.ac.nz/~hpan027/250-7-2.jpg&lt;br /&gt;
&lt;br /&gt;
 Tree[a,b,*c*,d,e,f,g]&lt;br /&gt;
&lt;br /&gt;
Post-rotation:&lt;br /&gt;
&lt;br /&gt;
http://studwww.cs.auckland.ac.nz/~hpan027/250-7-3.jpg&lt;br /&gt;
&lt;br /&gt;
 Tree[a,b,*c*,d,e,f,g]&lt;br /&gt;
&lt;br /&gt;
*Tree has been rotated to the left&lt;br /&gt;
*Order is still the same&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Right skewed to left ==&lt;br /&gt;
&lt;br /&gt;
http://studwww.cs.auckland.ac.nz/~hpan027/250-7-4.jpg&lt;br /&gt;
&lt;br /&gt;
*Using &amp;quot;rl&amp;quot; then &amp;quot;p&amp;quot; until the tree is left skewed (i.e. always rotating the tree to the right with respect to the root)&lt;br /&gt;
&lt;br /&gt;
http://studwww.cs.auckland.ac.nz/~hpan027/250-7-5.jpg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Right skewed into balanced ==&lt;br /&gt;
&lt;br /&gt;
*Use &amp;quot;p&amp;quot; and &amp;quot;rl&amp;quot; as above until tree is as follows&lt;br /&gt;
&lt;br /&gt;
http://studwww.cs.auckland.ac.nz/~hpan027/250-7-6.jpg&lt;br /&gt;
&lt;br /&gt;
*Then perform &amp;quot;rr&amp;quot; operations on node c and &amp;quot;rl&amp;quot; on node e&lt;br /&gt;
&lt;br /&gt;
http://studwww.cs.auckland.ac.nz/~hpan027/250-7-7.jpg&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Rebalancing after two elements ==&lt;br /&gt;
&lt;br /&gt;
http://studwww.cs.auckland.ac.nz/~hpan027/250-7-8.jpg&lt;br /&gt;
&lt;br /&gt;
*&amp;quot;rl&amp;quot; on root&lt;br /&gt;
&lt;br /&gt;
http://studwww.cs.auckland.ac.nz/~hpan027/250-7-9.jpg&lt;/div&gt;</summary>
		<author><name>Mark</name></author>
	</entry>
</feed>