Questions
Please find out how long it takes to sort a large array using both a sorting method that you write and using Java’s built-in sorting method.
1. Codes
1 | import java.util.Arrays; |
2. Outputs
When the array size is 1000:
1 | selectionSort runtimes: 5 ms |
When the array size is 10,000:
1 | selectionSort runtimes: 61 ms |
When the array size is 100,000:
1 | selectionSort runtimes: 4720 ms |