<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-US;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Arial","sans-serif";
        color:#1F497D;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";
        mso-fareast-language:EN-US;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-AU" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">Hi Andrew,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This went into an empty form, I can&#8217;t remember if I wrote it a couple of years ago or garnered it from elsewhere (if it was from someone else, thanks)
 . <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">Cheers<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D">Damien<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:blue">Sub</span> SortMe(<span style="color:blue">ByRef</span> a()
<span style="color:blue">As</span> <span style="color:blue">Object</span>, <span style="color:blue">
ByVal</span> left <span style="color:blue">As</span> <span style="color:blue">Integer</span>,
<span style="color:blue">ByVal</span> right <span style="color:blue">As</span> <span style="color:blue">
Integer</span>)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Dim</span> pivot <span style="color:blue">As</span> <span style="color:blue">
Integer</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">If</span> right - left &gt; 1 <span style="color:blue">Then</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pivot = getpivot(a, left, right)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pivot = partition(a, left, right, pivot)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SortMe(a, left, pivot)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SortMe(a, pivot &#43; 1, right)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">End</span> <span style="color:blue">If</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:blue">End</span> <span style="color:blue">Sub</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:blue">Sub</span> qsort(<span style="color:blue">ByRef</span> a()
<span style="color:blue">As</span> <span style="color:blue">Object</span>)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Dim</span> i<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Dim</span> ii<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">For</span> i = 0 <span style="color:blue">To</span> a.Length() - 1<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ii =
<span style="color:blue">New</span> System.<span style="color:#2B91AF">Random</span>().Next(0, a.Length() - 1)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">If</span> i &lt;&gt; ii <span style="color:blue">Then</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; swap(a(i), a(ii))<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">End</span> <span style="color:blue">If</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Next</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SortMe(a, 0, a.Length())<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:blue">End</span> <span style="color:blue">Sub</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:blue">Function</span> getpivot(<span style="color:blue">ByRef</span> a()
<span style="color:blue">As</span> <span style="color:blue">Object</span>, <span style="color:blue">
ByVal</span> left <span style="color:blue">As</span> <span style="color:blue">Integer</span>,
<span style="color:blue">ByVal</span> right <span style="color:blue">As</span> <span style="color:blue">
Integer</span>)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Return</span> <span style="color:blue">New</span> System.<span style="color:#2B91AF">Random</span>().Next(left, right - 1)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:blue">End</span> <span style="color:blue">Function</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:blue">Function</span> partition(<span style="color:blue">ByRef</span> a()
<span style="color:blue">As</span> <span style="color:blue">Object</span>, <span style="color:blue">
ByVal</span> left <span style="color:blue">As</span> <span style="color:blue">Integer</span>,
<span style="color:blue">ByVal</span> right <span style="color:blue">As</span> <span style="color:blue">
Integer</span>, <span style="color:blue">ByRef</span> pivot <span style="color:blue">
As</span> <span style="color:blue">Integer</span>)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Dim</span> i<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Dim</span> piv<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Dim</span> store<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; piv = a(pivot)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; swap(a(right - 1), a(pivot))<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; store = left<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">For</span> i = left <span style="color:blue">To</span> right - 2<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">If</span> a(i) &lt;= piv <span style="color:blue">Then</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; swap(a(store), a(i))<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; store = store &#43; 1<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">End</span> <span style="color:blue">If</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Next</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; swap(a(right - 1), a(store))<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Return</span> store<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:blue">End</span> <span style="color:blue">Function</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:blue">Sub</span> swap(<span style="color:blue">ByRef</span> v1,
<span style="color:blue">ByRef</span> v2)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Dim</span> tmp<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tmp = v1<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; v1 = v2<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; v2 = tmp<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:blue">End</span> <span style="color:blue">Sub</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:blue">Private</span> <span style="color:blue">Sub</span> Form1_Load(<span style="color:blue">ByVal</span> sender
<span style="color:blue">As</span> System.<span style="color:#2B91AF">Object</span>,
<span style="color:blue">ByVal</span> e <span style="color:blue">As</span> System.<span style="color:#2B91AF">EventArgs</span>)
<span style="color:blue">Handles</span> <span style="color:blue">MyBase</span>.Load<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Dim</span> MyArray() <span style="color:blue">As</span> <span style="color:blue">
Object</span> = {3, 7, 4, 0, 1, 12, 32, 4, 5}<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Dim</span> mystring <span style="color:blue">As</span> <span style="color:blue">
String</span> = <span style="color:#A31515">&quot;&quot;</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Dim</span> mystring2 <span style="color:blue">As</span> <span style="color:blue">
String</span> = <span style="color:#A31515">&quot;&quot;</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">For</span> counter = 0 <span style="color:blue">To</span> MyArray.Length - 1<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mystring = mystring &amp; MyArray(counter) &amp;
<span style="color:#A31515">&quot;, &quot;</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Next</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox(mystring, vbOKOnly)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; qsort(MyArray)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">For</span> counter = 0 <span style="color:blue">To</span> MyArray.Length - 1<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mystring2 = mystring2 &amp; MyArray(counter) &amp;
<span style="color:#A31515">&quot;, &quot;</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Next</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox(mystring2, vbOKOnly)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">End</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:9.5pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:blue">End</span> <span style="color:blue">Sub<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black;mso-fareast-language:EN-AU">Damien</span></b><b><span style="font-size:12.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black;mso-fareast-language:EN-AU">
</span></b><b><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black;mso-fareast-language:EN-AU">Atkinson-Buck</span></b><span style="font-size:12.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D;mso-fareast-language:EN-AU"><br>
</span><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black;mso-fareast-language:EN-AU">Head of Learning Area: Technology/Arts</span><span style="font-size:12.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black;mso-fareast-language:EN-AU">&nbsp;</span><span style="font-size:12.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D;mso-fareast-language:EN-AU"><br>
</span><span style="font-size:12.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D;mso-fareast-language:EN-AU"><img width="750" height="2" id="_x0000_i1030" src="cid:image001.png@01CF896A.DF1F41A0"></span><span style="font-size:12.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D;mso-fareast-language:EN-AU"><o:p></o:p></span></p>
<table class="MsoNormalTable" border="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:#1F497D;mso-fareast-language:EN-AU"><img width="135" height="66" id="_x0000_i1029" src="cid:image002.png@01CF896A.DF1F41A0"></span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;color:#1F497D;mso-fareast-language:EN-AU"><o:p></o:p></span></p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<table class="MsoNormalTable" border="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><b><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black;mso-fareast-language:EN-AU">p:</span></b><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black;mso-fareast-language:EN-AU"> &#43;61 3 9490 3848
</span><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D;mso-fareast-language:EN-AU"><o:p></o:p></span></p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><b><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black;mso-fareast-language:EN-AU">e:</span></b><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black;mso-fareast-language:EN-AU">
<a href="mailto:damien.atkinson-buck@ivanhoe.com.au"><span style="color:blue">damien.atkinson-buck@ivanhoe.com.au</span></a></span><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D;mso-fareast-language:EN-AU">
<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><b><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black;mso-fareast-language:EN-AU">f:</span></b><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black;mso-fareast-language:EN-AU"> &#43;61 3 9490 3490</span><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D;mso-fareast-language:EN-AU"><o:p></o:p></span></p>
</td>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><b><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black;mso-fareast-language:EN-AU">w:</span></b><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D;mso-fareast-language:EN-AU">
<a href="http://www.ivanhoe.com.au/"><span style="color:blue">www.ivanhoe.com.au</span></a><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;mso-fareast-language:EN-AU">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;;mso-fareast-language:EN-AU"> Anthony
 Sullivan [mailto:asullivan@tps.vic.edu.au] <br>
<b>Sent:</b> Sunday, 15 June 2014 2:12 PM<br>
<b>To:</b> sofdev@edulists.com.au<br>
<b>Subject:</b> [Year 12 SofDev] Quick Sort Code<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt">I&#8217;m trying to code the Quick Sort algorithm from the textbook (page 126) into Visual Basic &#8211; but having a few problems<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">If anybody has a working example of this algorithm would it be possible to ask for a copy of the code?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt">Anthony<o:p></o:p></span></p>
<p>&nbsp;<o:p></o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="1200" style="width:900.0pt">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p><strong><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black">Anthony&nbsp;Sullivan</span></strong><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black"><br>
</span><span style="font-size:9.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#666666">Head of Information Technology</span><o:p></o:p></p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p style="mso-margin-top-alt:4.0pt;margin-right:0cm;margin-bottom:0cm;margin-left:0cm;margin-bottom:.0001pt">
<span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#A5A5A5">20 Wooralla Drive, Mt. Eliza, Vic, 3930</span><o:p></o:p></p>
</td>
</tr>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#A5A5A5;mso-fareast-language:EN-AU">T: 03 9788 7796&nbsp;| F: 03 9787 7646 |&nbsp;<a href="mailto:asullivan@tps.vic.edu.au">asullivan@tps.vic.edu.au</a> |
<a href="http://www.tps.vic.edu.au">www.tps.vic.edu.au</a></span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-AU"><o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;display:none;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" width="580" style="width:435.0pt">
<tbody>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#C0504D;mso-fareast-language:EN-AU"><img border="0" width="580" height="105" id="_x0000_i1025" src="cid:image003.gif@01CF896A.DF1F41A0"></span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-AU"><o:p></o:p></span></p>
</td>
</tr>
<tr style="height:22.5pt">
<td valign="bottom" style="padding:0cm 0cm 0cm 0cm;height:22.5pt">
<p><span style="font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><a href="http://www.facebook.com/pages/The-Peninsula-School/118935504829400?ref=hl"><span style="text-decoration:none"><img border="0" width="25" height="25" id="_x0000_i1026" src="cid:image004.gif@01CF896A.DF1F41A0"></span></a>&nbsp;<a href="http://https:/twitter.com/TPSMtEliza"><span style="text-decoration:none"><img border="0" width="25" height="25" id="_x0000_i1027" src="cid:image005.gif@01CF896A.DF1F41A0"></span></a>&nbsp;<a href="http://www.youtube.com/user/ThePeninsulaSchool"><span style="text-decoration:none"><img border="0" width="25" height="25" id="_x0000_i1028" src="cid:image006.gif@01CF896A.DF1F41A0"></span></a></span><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" align="left" width="650" style="width:487.5pt">
<tbody>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-element:frame;mso-element-frame-hspace:2.25pt;mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:column;mso-height-rule:exactly">
<span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-AU">&nbsp;<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="padding:0cm 0cm 0cm 0cm">
<p class="MsoNormal" style="mso-element:frame;mso-element-frame-hspace:2.25pt;mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:column;mso-height-rule:exactly">
<span style="font-size:8.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#92D400;mso-fareast-language:EN-AU">Please consider the environment before printing this email, you will save 5g of paper, 250mL of water and at least 35gm of CO</span><span style="font-size:5.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#92D400;mso-fareast-language:EN-AU">2</span><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-AU"><o:p></o:p></span></p>
</td>
</tr>
<tr>
<td width="650" style="width:487.5pt;padding:0cm 0cm 0cm 0cm">
<p style="mso-element:frame;mso-element-frame-hspace:2.25pt;mso-element-wrap:around;mso-element-anchor-vertical:paragraph;mso-element-anchor-horizontal:column;mso-height-rule:exactly">
<span style="font-size:7.0pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:#A5A5A5">This message, including any attachments, is provided without responsibility in law for its accuracy or otherwise and without assumption of a duty of care by the school. Whilst every
 attempt has been made to ensure material in this e-mail message is free from computer viruses or other defects, the attached files are provided, and may only be used, on the basis that the user assumes responsibility for the use of the material transmitted.
 This e-mail is intended for the use of the named individual or entity and may contain confidential and privileged information. Any dissemination, distribution or copying by anyone other than the intended recipient of this e-mail is strictly prohibited. If
 this e-mail has been received in error then please notify The Peninsula School immediately and destroy the original message.</span><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;<o:p></o:p></p>
<p>&nbsp;<o:p></o:p></p>
<p>&nbsp;<o:p></o:p></p>
<p>&nbsp;<o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;,&quot;serif&quot;;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
</div>
<br>
<br>
<br>
<br>
Privacy, Virus and Copyright Warning<br>
<br>
The information contained in this electronic message (e-mail), and any files transmitted with it:<br>
<br>
* is intended for the named recipients only. If you have received this in error, please advise the sender and delete it and any copies immediately;<br>
* Any personal information in this email must be used in accordance with the Privacy Act 1988 and this always applies even if it has been sent to you in error.<br>
* represents the views of the sender and does not necessarily represent the views or formal advice of Ivanhoe Grammar School;<br>
* may be subject to Copyright, so no further use should be made of it without the author's permission.<br>
<br>
The School does not represent or warrant that the email or any files attached do not contain errors or are free from computer viruses or other defects nor does it accept responsibility for any loss or damage resulting directly or indirectly from the use of
 the email or any attached files.
</body>
</html>