Henry Wong wrote:
Sean Lim wrote:
How does the compare() method determine which strings it uses as a, and as b?
It doesn't. It is the sorting algorithm that determines which elements that it needs to compare -- and that is algorithm dependent.
Henry
Thanks Henry, but which algorithm is it using in the code posted? All I see is that it's using the Array's sort method and that it would be in natural order? But because it flipped the arguments it is actually in reverse natural order, as far as I can tell.
Thanks Anbarasu for pointing that out.