On Oct 24, 2006, at 7:02 PM, Colin Scarrott wrote:

Good idea, thanks for that, i'll have a play around.
Colin

But nothing prevents you from cheating and sorting a private copy of the array with leading zeroes... as long as you keep the two arrays' elements in parallel you should be okay. You can then hand off the 'real' array back to whatever client code called it.

I probably should have said, "... in sync"; not "... in parallel". That is, if - in the sort routine, you swap element 2 and 17 (for example) in the 'test' array, you need to swap them in the real array, too. This way, when you pass the array back, it'll be in sorted order even though no comparisons were done on any of its elements.. The key to this sort of 'optimization' is to determine how many significant leading zeroes (maximum) you'll ever need; you can then make a simple method that takes the test string and returns a string with the leading zeroes in it. You then fill your test array with this data, keeping your original array safe.
  HTH!

On Oct 24, 2006, at 6:51 PM, Colin Scarrott wrote:

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to