What is the time complexity of java.util.Collections.sort() method?

后端 未结 4 1783
挽巷
挽巷 2020-12-15 17:39

I have written the following class:

public class SortingObjectsWithAngleField implements Comparator {  
    public int compare(Point p1, Point p         


        
4条回答
  •  离开以前
    2020-12-15 18:07

    Taken from Collections.sort -

    The sorting algorithm is a modified mergesort (in which the merge is omitted if the highest element in the low sublist is less than the lowest element in the high sublist). This algorithm offers guaranteed n*log(n) performance

提交回复
热议问题