<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)">
<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:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        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";}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.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="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-AU">Hi Trav,<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-AU">Here&#8217;s a little queue example that I&#8217;ve used<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-AU">Regards Chris<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-AU"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-AU">Module</span><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">
<span style="color:#2B91AF">Module1</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;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:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:blue">Sub</span> Main()<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Dim</span> getYourBurger <span style="color:blue">As</span>
<span style="color:blue">New</span> <span style="color:#2B91AF">HomeMadeQueue</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;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:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:green">'Add some people to the queue</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#2B91AF">Console</span>.WriteLine(<span style="color:#A31515">&quot;Add 'Chris' to the Queue&quot;</span>)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; getYourBurger.EnQueue(<span style="color:#A31515">&quot;Chris&quot;</span>)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#2B91AF">Console</span>.WriteLine(<span style="color:#A31515">&quot;Add 'Jill' to the Queue&quot;</span>)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; getYourBurger.EnQueue(<span style="color:#A31515">&quot;Jill&quot;</span>)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#2B91AF">Console</span>.WriteLine(<span style="color:#A31515">&quot;Add 'Ted' to the Queue&quot;</span>)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; getYourBurger.EnQueue(<span style="color:#A31515">&quot;Ted&quot;</span>)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#2B91AF">Console</span>.WriteLine(<span style="color:#A31515">&quot;Add 'Mel' to the Queue&quot;</span>)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; getYourBurger.EnQueue(<span style="color:#A31515">&quot;Mel&quot;</span>)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;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:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:green">'How long is that queue?</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Dim</span> numberPeopleInQueue <span style="color:blue">
As</span> <span style="color:blue">Integer</span> = getYourBurger.Count<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#2B91AF">Console</span>.WriteLine(<span style="color:#A31515">&quot;Queue length is:&quot;</span> &amp; numberPeopleInQueue)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;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:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:green">'Who is first in line?</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#2B91AF">Console</span>.WriteLine(<span style="color:#A31515">&quot;The first in line is:&quot;</span> &amp; getYourBurger.Peek)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;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:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:green">'Process the queue ... do you want fries with that???</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">For</span> counter <span style="color:blue">As</span> <span style="color:blue">
Integer</span> = 1 <span style="color:blue">To</span> numberPeopleInQueue<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#2B91AF">Console</span>.WriteLine(<span style="color:#A31515">&quot;Hi &quot;</span> &amp; getYourBurger.DeQueue() &amp;
<span style="color:#A31515">&quot;, what burger would you like?&quot;</span>)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;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:12.0pt;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:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:green">'What happens if we try to process an empty queue</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#2B91AF">Console</span>.WriteLine(<span style="color:#A31515">&quot;Is there anybody out there??? &quot;</span> &amp; getYourBurger.DeQueue())<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;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:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:#2B91AF">Console</span>.ReadLine()<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;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:12.0pt;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:12.0pt;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:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:green">''' </span><span style="color:gray">&lt;summary&gt;</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:green">''' The following Queue class implementation includes methods for EnQueue,</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:green">''' DeQueue, ClearQueue (clearing the queue), Peek, and Count, as well as a</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:green">''' default constructor for the class.</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:green">''' </span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:green">''' The underlying data structure used to hold the queue data is an ArrayList.&nbsp; This is</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:green">''' used because their dynamic nature, i.e. Insert is added to the next free element of the list,
</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:green">''' remove from front automatically moves each item in the list up one element, and we don't need
</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:green">''' to maintain any placeholders (first item, last item etc...)</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:green">''' </span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:green">'''
</span><span style="color:gray">&lt;/summary&gt;</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:green">''' </span><span style="color:gray">&lt;remarks&gt;</span><span style="color:green">This is closely based on content from &quot;Data Structures and Algorithms Using Visual Basic.NET&quot;</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:green">'''&nbsp; by Michael McMillan (ISBN:9780521547659)</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:green">''' </span><span style="color:gray">&lt;/remarks&gt;</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:blue">Public</span> <span style="color:blue">Class</span> <span style="color:#2B91AF">
HomeMadeQueue</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Private</span> _queue <span style="color:blue">As</span>
<span style="color:blue">New</span> <span style="color:#2B91AF">ArrayList</span>()<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Public</span> <span style="color:blue">Sub</span> <span style="color:blue">
New</span>()<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">MyBase</span>.New()<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;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">Sub</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Public</span> <span style="color:blue">Sub</span> EnQueue(<span style="color:blue">ByVal</span> item
<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:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _queue.Add(item)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;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">Sub</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Public</span> <span style="color:blue">Function</span> DeQueue()
<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:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Dim</span> item <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:12.0pt;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> Count() &gt; 0 <span style="color:blue">Then</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; item = _queue.Item(0)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _queue.RemoveAt(0)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Else</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; item =
<span style="color:#A31515">&quot;Queue empty error&quot;</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;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:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Return</span> item<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;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">Function</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Public</span> <span style="color:blue">Function</span> Peek()
<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:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Return</span> _queue.Item(0)<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;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">Function</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Public</span> <span style="color:blue">Sub</span> ClearQueue()<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _queue.Clear()<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;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">Sub</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Public</span> <span style="color:blue">Function</span> Count()
<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:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="color:blue">Return</span> _queue.Count()<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;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">Function</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;&nbsp;
<span style="color:blue">End</span> <span style="color:blue">Class</span><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;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:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">&nbsp;&nbsp;
<o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:12.0pt;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:12.0pt;font-family:Consolas;color:blue;mso-fareast-language:EN-AU">End</span><span style="font-size:12.0pt;font-family:Consolas;mso-fareast-language:EN-AU">
<span style="color:blue">Module<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="color:#1F497D"><o:p>&nbsp;</o:p></span></a></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"> sofdev-bounces@edulists.com.au
 [mailto:sofdev-bounces@edulists.com.au] <b>On Behalf Of </b>Travis Parker<br>
<b>Sent:</b> Thursday, 4 August 2011 8:16 AM<br>
<b>To:</b> Year 12 Software Development Teachers' Mailing List<br>
<b>Subject:</b> [Year 12 SofDev] Queues in VB.net<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">Dear All,<span style="color:#1F497D"><o:p></o:p></span></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">I am currently doing some stuff in data structures and going to create a queue example in VB.net. Does anyone have an example of these? I am thinking that I will use a queue as part of U4O1.
 I&#8217;ve already done a stack example but am going to write a SAC with a waiting list FIFO so need to use a queue.<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Any assistance from the brilliant programmers on the list would be much appreciated and save me some time!<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Cheers<o:p></o:p></span></p>
<p><span style="font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Trav<o:p></o:p></span></p>
</div>
</body>
</html>