I’m using Collection.sort(Array<objectX>, Comperator<objectX>) in java/Android.
In my comperator I compare two objects using their ID.
How can I know in which method this sort is made? (quicksort, mergesort…)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Technically speaking which algorithm to use is not specified (in other words it’s runtime library specific).
From the documentation:
In practice, it typically chooses one sorting technique of of several based on the length of the list etc. In the standard implementation from Sun/Oracle it chooses between insertion sort (if the length is less than 7) and merge sort otherwise.