<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
<br style="text-indent: 0in !important; ">> ><br style="text-indent: 0in !important; ">> > Well it engaged my students and got them interested in seeing how <br style="text-indent: 0in !important; ">> > it's implemented.<br style="text-indent: 0in !important; ">> ><br style="text-indent: 0in !important; ">> > It also provides me with a vehicle for introducing do and arrays <br style="text-indent: 0in !important; ">> > both of which they need to learn.<br style="text-indent: 0in !important; ">> <br style="text-indent: 0in !important; ">> Seems to me it would make more sense to motivate arrays with the <br style="text-indent: 0in !important; ">> purpose they really serve, O(1) access to a large collection of data, <br style="text-indent: 0in !important; ">> as with graphs or union-find, or more mundanely perhaps, game boards <br style="text-indent: 0in !important; ">> and other stuff where Schemers would tend to prefer lists.<br style="text-indent: 0in !important; ">> <div style="text-indent: 0in !important; "><br style="text-indent: 0in !important; "></div><div style="text-indent: 0in !important; ">My students aren't probably haven't and will likely never take a discrete math course and don't know what a graph is. Discrete Math is not a prerequisite for their curriculum. The examples are more esoteric than necessary.</div><div style="text-indent: 0in !important; "><br style="text-indent: 0in !important; "></div><div style="text-indent: 0in !important; ">I have already explained O(1) access that arrays provide and when you need it. I motivated it using Brian Harvey's example of a lap counter in Simply Scheme. That simultaneously introduced the need for state and then O(1) access to update the lap counter for each car in the race and used an example that a primary school kid could understand. I did not see a reason to conflate the manipulation of arrays with the motivation. If you were to ask them now they could probably give a pretty good explanation as to why an array should not be the data structure of choice for summing a list of numbers. To be fair I did say I was doing that with bubble sort but I really meant motivating an example of array manipulation and I wanted to do that with an example where an array was genuinely appropriate.</div><div style="text-indent: 0in !important; "><br style="text-indent: 0in !important; "></div><div style="text-indent: 0in !important; ">></div><div style="text-indent: 0in !important; ">> I say this just because using bubblesort to motivate do & arrays seems <br style="text-indent: 0in !important; ">> kind of like the hardcore Schemers (not of the PLT school of thought) <br style="text-indent: 0in !important; ">> using factorial & exp-time fibonacci to motivate recursion...i.e., <br style="text-indent: 0in !important; ">> losing some students, understandably, at "why would I care about <br style="text-indent: 0in !important; ">> that?" and others at "wait--so people use this stuff for algorithms <br style="text-indent: 0in !important; ">> that are so bad nobody uses them?"<br style="text-indent: 0in !important; ">> <br style="text-indent: 0in !important; "><br style="text-indent: 0in !important; "></div><div style="text-indent: 0in !important; ">Count me in their number.</div><div style="text-indent: 0in !important; "><br style="text-indent: 0in !important; "></div><div style="text-indent: 0in !important; ">Past exam questions have been to write a recursive then iterative version of fibonacci and to write factorial and use it to implement a program that takes n and k and calculates n choose k. </div><div style="text-indent: 0in !important; "><br style="text-indent: 0in !important; "></div><div style="text-indent: 0in !important; ">I'd rather they answer those than the ones that require them to manipulate files or arrays.</div><div><br></div>                                            <br /><hr />Not got a Hotmail account? <a href='http://clk.atdmt.com/UKM/go/197222280/direct/01/' target='_new'>Sign-up now - Free</a></body>
</html>