-
Notifications
You must be signed in to change notification settings - Fork 0
/
answers.txt
28 lines (17 loc) · 1.33 KB
/
answers.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
sort1 uses: bubble
How do you know?: Similar explanation in determining sort3 below.
sort2 uses: merge
How do you know?: In general, in all the cases, the big picture shows that sort2 takes fastest time to sort in every list. Hence, it's merge sort.
sort3 uses: selection
How do you know?: At best case scenario, the lists are sorted in ascendent. Considered the sorted cases, aka big-omega cases, sort1 is faster than sort3. Hence, sort1 is bubble sort (big-omega = n), sort3 is selection sort (big-omega = n^2).
| sort1: | sort2: | sort3:
random5000 | 0.062-0.112 | 0.013-0.020 | 0.034-0.096
random10000 | 0.485-0.524 | 0.020-0.104 | 0.174-0.244
random50000 | 14.463-15.465 | 1.873-2.929 | 6.812-9.030
reversed5000 | 0.066-0.104 | 0.007-0.016 | 0.035-0.041
revertsed10000 | 0.357-0.486 | 0.018-0.066 | 0.168-0.372
reversed50000 | 12.366-12.510 | 2.429-3.500 | 7.503-8.144
sorted5000 | 0.009-0.089 | 0.010-0.014 | 0.034-0.054
sorted10000 | 0.02-0.074 | 0.02-0.051 | 0.226-0.248
sorted50000 | 1.654-2.638 | 1.605-3.014 | 7.627-8.068
guess: | bubble sort | merge sort | selection sort