Answer the question
In order to leave comments, you need to log in
.sort() which sort method does it use? binary insertion sort?
I looked in the code, and everything goes so deep, one sort calls another, I'm not sure, but in the end it comes to the binarySort method, which says:
Sorts the specified portion of the specified array using a binary
* insertion sort. This is the best method for sorting small numbers
* of elements. It requires O(n log n) compares, but O(n^2) data
* movement (worst case).
Answer the question
In order to leave comments, you need to log in
In theory, it depends on what you call this method from.
TimSort for an array of objects, qsort for an array of primitives, for example. Well, I googled it . And right off the bat I would just say TimSort. Surely there, if you dig, there are some other super-optimizations.
What you found is most likely a piece of TimSort .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question