<br><br><div class="gmail_quote">On 29 November 2010 10:54, Steven Bird <span dir="ltr"><<a href="mailto:sb@csse.unimelb.edu.au">sb@csse.unimelb.edu.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On 29 November 2010 10:38, Mark KELLY <<a href="mailto:kel@mckinnonsc.vic.edu.au">kel@mckinnonsc.vic.edu.au</a>> wrote:<br>
> Most programming languages now offer GUI data structures like listboxes,<br>
> grids etc.<br>
> I'm interested to know how many people use them as their primary data<br>
</div>> structures ...<br>
<br>
Are you talking about how you use the graphical interface of the IDE<br>
that comes with your favourite programming language, or are you<br>
talking about the API to the graphics library that comes with the<br>
language?<br></blockquote><div><br>Yes - the IDE's GUI controls (listboxes, grids, combo boxes etc)<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im"><br>
> What sort of performance penalty does the use of the GUI data structure<br>
> impose? Do the GUI structure's capabilities (e.g. auto-sorting lists)<br>
> outweigh the penalty?<br>
> How efficient is the GUI's inbuilt sorting algorithm compared to a good<br>
> do-it-yourself sorting algorithm?<br>
<br>
</div>A built-in sorting function will usually be close to the optimal O(n<br>
log n) performance. If you implement your own (by why would you<br>
these days?) then it might be as bad as O(n^2). However, the<br>
difference between these is likely to be insignificant for the size of<br>
data you're talking about. The dominant factor might be that the<br>
built-in function was compiled, while yours might be interpreted (if<br>
you're using VB, PHP, Python, etc).<br></blockquote><div><br>Yes, 1000 guys at Microsoft would probably beat me in an algorithm contest. ;-) <br>But if you have a large array and you need to sort it, you need to sort it. You either write your own sort routine, or toss the data into a pre-packaged object and use its methods to do the job for you. <br>
<br>I was more interested in the performance differences between using a listbox (say) rather than an array. <br>
I'm guessing it's like lazily choosing 'variant' in VB instead of
carefully crafting your variable types and your explicit typecasts.<br>
<br>I sometimes duplicate data in an array (for processing) and a GUI structure (e.g. a listbox) for display and data entry. Programming (for me at least) is usually a private, solo activity and there is not a lot of opportunity to see how other people do things, so I was interested in how other people choose to use primitive and GUI alternative data structures if both are available.<br>
<br>Cheers<br>Mark<br><br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<font color="#888888"><br>
-Steven Bird<br>
<a href="http://www.csse.unimelb.edu.au/%7Esb/" target="_blank">http://www.csse.unimelb.edu.au/~sb/</a><br>
</font><div><div></div><div class="h5">_______________________________________________<br>
<a href="http://www.edulists.com.au" target="_blank">http://www.edulists.com.au</a> - FAQ, Subscribe, Unsubscribe<br>
IT Software Development Mailing List kindly supported by<br>
<a href="http://www.vcaa.vic.edu.au" target="_blank">http://www.vcaa.vic.edu.au</a> - Victorian Curriculum and Assessment Authority and<br>
<a href="http://www.vcaa.vic.edu.au/vce/studies/infotech/softwaredevel3-4.html" target="_blank">http://www.vcaa.vic.edu.au/vce/studies/infotech/softwaredevel3-4.html</a><br>
<a href="http://www.vitta.org.au" target="_blank">http://www.vitta.org.au</a> - VITTA Victorian Information Technology Teachers Association Inc<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Mark Kelly<br>Manager Information Systems<br>Reporting Manager<br>IT Learning Area Manager<br><br>McKinnon Secondary College<br>McKinnon Rd McKinnon 3204<br>Victoria, Australia<br>
Direct line / Voicemail: +613 8520 9085<br>Fax +613 9578 9253<br><a href="mailto:kel@mckinnonsc.vic.edu.au" target="_blank">kel@mckinnonsc.vic.edu.au</a><br><br>VCE IT Lecture Notes: <a href="http://vceit.com" target="_blank">http://vceit.com</a><br>
Moderator: IT Applications Edulist<br>My cow died on this day two years ago. I know because I noted it in my dairy.<br><br><br>