aspose file tools*
The moose likes Java in General and the fly likes Which sort does sort() use? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Which sort does sort() use?" Watch "Which sort does sort() use?" New topic
Author

Which sort does sort() use?

Manish Malik
Greenhorn

Joined: Jan 27, 2001
Posts: 19

Which sorting algorithm does sort() function use?

Manish
Matt Senecal
Ranch Hand

Joined: Dec 01, 2000
Posts: 255
Which sort() are you referring to? java.util.Arrays.sort() uses a form of Quicksort.
Originally posted by Manish Malik:

Which sorting algorithm does sort() function use?


There's nothing more dangerous than a resourceful idiot. ---Dilbert
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
And the one in Collections uses a mergesort. The API has more details. Always check the API. If you want more, you can always look at the source code inside src.jar.


"I'm not back." - Bill Harding, Twister
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Which sort does sort() use?
 
Similar Threads
chair oil
Hashmap in java
how the the same operation with "pipe"...
Sorting in Java
Long concatenated SQL stmts