Next:
Up:
Previous:
Order of Growth
The ORDER of a running-time function
is the fastest growing term, discarding constant factors.
Insertion Sort:
Best Case:
Worst Case:
XYZ-Sort:
Worst Case:
Now we can say Insertion-Sort better than XYZ-Sort
for large inputs
.
Size n
Complexity
10
20
30
40
50
60
n
.00001 s
.00002 s
.00003 s
.00004 s
.00005 s
.00006 s
n
2
.0001 s
.0004 s
.0009 s
.0016 s
.0025 s
.0036 s
n
3
.001 s
.008 s
.027 s
.064 s
.125 s
.216 s
n
5
.1 s
3.2 s
24.3 s
1.7 min
5.2 min
13.0 min
2
n
.001 s
1.0 s
17.9 min
12.7 days
35.7 years
366 centuries
3
n
.059 s
58 min
6.5 years
3855 centuries
2
x
10
8
centuries
1.3
x
10
13
centuries
Next:
Up:
Previous: