Array Searching Techniques

 







When you're not going to use your PC for an  hour or so, run my sample programs with numA=1000, or even more, and then compare the timings between Example 1 and Example 6 - its just staggering! By the way, turn off your screen saver if you are going to rest with a large number of elements - the screen saver will take away CPU resiurces and make the timings invalid!



All the above examples are in a complete program that you can download from here.  The program is designed so that you can change the variable 'numA' at the start of the program and then run timing tests to determine which technique suits your particular application. This HTM page is also included in the ZIP (and is the only documentation you get ... sorry).

Well that's it!  You now know how to speed up your searches and hopefully have learnt a couple of good programming techniques as well.  In case you're interested: I'm new to Liberty Basic (got my copy mid December 1997), but I have been a computer professional for 30 years and have coded in about 10 different programming languages. The techniques above are not specific to Liberty Basic, experienced programmers use identical techniques all the time, no matter what language they use.
Please give me some feedback as to whether this article has useful, or if I'm too technical, not technical enough, or  ...... whatever.  With a bit of encouragement, I may consider to documenting a few more techniques on other areas.
Email: Brosco
This document (and associated programs) is free from any copyright.  Please feel free, to copy, cut and paste, utilise, distribute, .... whatever.  The only stipulation that I have is: if you publish the contents in any form, be courteous enough to give credit to me for the original content!