Collections.sort
method is indeed O(N log N). Your program should generate an ArrayList of random numbers (whose size is specified by the user). It should then sort the list using the Collections.sort
method and time the sort. Note: one way to estimate run-time is to utilize the System.currentTimeMillis
method. For example:
Provide run-times for your code on increasingly large lists of numbers, and argue whether your data supports the claim that Collections.sort
is O(N log N).