Thursday, October 30, 2008

Sorting in LotusScript


In this (old) redbook, in Appendix B-4, you will find Lotus Script code for all the algorithms shown in the graph. I allwas use the QuickSort - think this works best in most situations.
Also check this Animated Sorting Algorithms site

Conclusion from the redbook:
Sorting can be a complex issue to decide. The amount of time taken to get

your data into arrays to allow you to use a sort routine may be longer than

the actual sorting. You then will need to get the sorted data out of those

arrays. You may be able to sort the data as you are preparing it or use the

resulting array as is.

There are many factors that influence the type of sort to use. Maybe creating

an extra view will solve all your problems.

In any case, you’ll need to think about your sorting needs. The examples

here use internal arrays of strings, so the problem is nicely encapsulated. For

these examples, the shell sort routine seems to be the easiest to code and

provides excellent performance.

If you are in a position to require a sophisticated sorting routine, spend some

time understanding these routines, and do some reading. The differences in

performance can be amazing!

0 comments:

 
Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License.