blob: 27e24615c6ec2b90e1d77225904d84813cbc9f71 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
sort1 uses: Bubble sort
How do you know?: time is low for sorted, as it should be for Omega(n), and time is high for reversed, as it should be for O(n^2)
sort2 uses: Merge sort
How do you know?: time is the same for sorted, random, and reversed, which matches with merge sort being theta(n log n) for time
sort3 uses: Selection sort
How do you know?: time is similar for sorted, random, and reversed, which matches with selection sort being theta(n^2) for time
|