Sorting in a macro
On Mon, 10 Jan 2005 22:57:58 -0500, Tom Ogilvy wrote:
A bubble sort - it could be replaced with a quicksort. Some testing I did a
long time ago, it appeared to be faster to use the collection to get
uniques, then do the sort on a reduced list vice sort and array and then
have your code (not using a collection) go through and eliminate the
duplicates. The speed difference was more noticeable as the size of the
list increased (the collection approach stayed fairly constant as I recall).
Hi Tom,
I finally got around to finishing the macro that used this. I ended up
using the collection method. As neat as your sort macro was, the problem
was all around simpler when using a Collection.
The list will never be more than a few hundred in this use, but duplicates
will be many. So removing them first made sense.
Thanks, Don <donwiss at panix.com.
|