Which of the two Java sorting methods, Collections.sort(list) or list.sort(Comparator.naturalOrder()), is more efficient?
List<Integer> list = new ArrayList<>(Arrays.asList(2, 3, 1));
//1.Collections
Collections.sort(list);
System.out.println(list);// [1, 2, 3]
//2.import java.util.Comparator;
list.sort(Comparator.naturalOrder());
System.out.println(list);// [1,2,3]
I expect that there won't be a significant performance difference when comparing the algorithms of these two methods.