View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Alan Beban[_2_] Alan Beban[_2_] is offline
external usenet poster
 
Posts: 783
Default Question for Alan on QuickSort

First I'll get something off my chest. Last time your post was directed
specifically to me I responded first in the newsgroup, then followed up
with an email inquiry--got nothing from you. So despite my better
judgment, I'll try again.

Marston wrote:

Alan -

Two questions:

1) I think I finally figured out why I'm having trouble sorting one of
my arrays using your great routine - but maybe you can confirm. Does
quicksort only work with arrays that are greater than 1D?


The QuickSort routine included at my web site is not my routine; I don't
even remember where I got it. It works only with 1-D arrays.

I had an
array that was something as follows:

aRay(0) = "100000"
aRay(1) = "100100"
aRay(2) = "100200"
aRay(3) = "100250"
etc.

When I tried to used QuickSort with the following code:

QuickSort aRay, 1, LBound(aRay,1), UBound(aRay,1), True
I ended up getting a subscript out of range error on
the line:

X = SortArray((L+r)/2,col)


You can't have been using the QuickSort that is included on my web site
because it allows for only three arguments; you would get a Wrong number
of arguments or invalid property assignment error entering it the way
you describe above. So what's up?

I'm getting ready to try creating a temporary array that will move my
array to

tempaRay(0,1) = aRay(0)
etc. in hopes that that will work...

Am I correct in my assumption?

2)

I saw in some old posts a routine called QSort by David Braden.
Do you have any knowledge of the difference from your routine and the
one included in your download in terms of speed sorting large arrays?


In short, no. But I really don't know what distinction you're intending
between "your [i.e., my] routine" and "the one included in your [i.e.,
my] download."

Alan Beban