posted 16 years ago
There's no one "fastest" algorithm; there are some special-case sorts you can do in time proportional to the number of items, but most general-purpose fast sorts perform in time proportional to the number of items times the logarithm of that number. Sometimes a fast sort can "accidentally" run much more slowly, if, for example, the data is already mostly sorted. High-quality implementations can avoid this kind of problem, which is why it's always a much better idea to use a library sort than to try to implement your own.
Colletions.sort() is an implementation of mergesort, by the way.