View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
agarwaldvk[_47_] agarwaldvk[_47_] is offline
external usenet poster
 
Posts: 1
Default Sorting Algorithm required!


Dave

I now recall where I got to know of you! Here it was!

I have now been able to implement your MSD Radix sort to suit my
requirement. It works OK for a one dimensional array of strings - no
problems.

However, how can I get it going where I have a 2 dimensional array of
strings ('n' rows and 'm' columns) and I need to sort the same by more
than one column. I have tried 2 ways of doing it (in both cases by
repeatedly Radix sorting the array from the least significant column to
the most significant column) - both go through their entire cycles but
neither give the correct output.

One of the ways that I have gone is to split the original array in to 2
arrays :-
One containing only data from the column that the array is to be
sorted by and
The other containing the data from all the other columns in the
array

There was no problem working with the data from the array that the
column is to be sorted by. But, even after all this much of effort I
still have got no idea how to determine and associate the position of
the corresponding strings from the other columns (these are in the
second array) belonging to the same row - to ensure that all the data
along a single row from all the columns stay together - with the data
from the column that the array is being sorted by.

If it might help I can send my version of your modified code to you. Or
you might even give me just a guidance as how to get around the above
problem.


Any suggestions please!



Best regards


Deepak Agarwal


--
agarwaldvk
------------------------------------------------------------------------
agarwaldvk's Profile: http://www.excelforum.com/member.php...o&userid=11345
View this thread: http://www.excelforum.com/showthread...hreadid=272317