[Q&A]What sorting algorithm is used in java.util.arrays
java.util.Arrays
uses quicksort (actually dual pivot quicksort in the most recent version) for primitive types such as int
and mergesort for objects that implement Comparable
or use a Comparator.
Refer to:
Why java.util.Arrays uses Two Sorting Algorithms
0 comments:
Post a Comment