

















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


















































George Mason University, Department of Computer Science
R. Paul Wiegand George Mason University, Department of Computer Science
R. Paul Wiegand George Mason University, Department of Computer Science
R. Paul Wiegand George Mason University, Department of Computer Science
Sort(a 1 , a 2 , · · · , an )
a 11 · · · an 1
a 1 m · · · anm
b 11 · · · bm 1
b 1 k · · · bmk
p(x) = anx
n
R. Paul Wiegand George Mason University, Department of Computer Science
Sort(a 1 , a 2 , · · · , an) Number of list elements
a 11 · · · an 1
a 1 m · · · anm
b 11 · · · bm 1
b 1 k · · · bmk
Order of matrices?
Total number of elements?
p(x) = an x
n
R. Paul Wiegand George Mason University, Department of Computer Science
Sort(a 1 , a 2 , · · · , an) Number of list elements
a 11 · · · an 1
a 1 m · · · anm
b 11 · · · bm 1
b 1 k · · · bmk
Order of matrices?
Total number of elements?
p(x) = an x
n
Degree of polynomial?
Total number of coefficients?
R. Paul Wiegand George Mason University, Department of Computer Science
Sort(a 1 , a 2 , · · · , an )
a 11 · · · an 1
a 1 m · · · anm
b 11 · · · bm 1
b 1 k · · · bmk
R. Paul Wiegand George Mason University, Department of Computer Science
Sort(a 1 , a 2 , · · · , an) Key comparisons
a 11 · · · an 1
a 1 m · · · anm
b 11 · · · bm 1
b 1 k · · · bmk
R. Paul Wiegand George Mason University, Department of Computer Science
Sort(a 1 , a 2 , · · · , an) Key comparisons
a 11 · · · an 1
a 1 m · · · anm
b 11 · · · bm 1
b 1 k · · · bmk
Additions?
Multiplications?
1
2
R. Paul Wiegand George Mason University, Department of Computer Science
x
b
a
log b x
logb a
R. Paul Wiegand George Mason University, Department of Computer Science
0 20 40 60 80 100
0e+
2e+
4e+
6e+
8e+
1e+
x
y
y =x
y =x 2
y =x 3
y =x 4
y =
x
R. Paul Wiegand George Mason University, Department of Computer Science
0 20 40 60 80 100
0e+
2e+
4e+
6e+
8e+
1e+
x
y
y =x
y =x 2
y =x 3
y =x 4
y =
x
1 Constant
log n Logarithmic (sub-linear)
n Linear
n lg n n-log-n
n
k , for some constant k Polynomial
k
n , for some constant k Exponential
n! Factorial (“Exponential”)
R. Paul Wiegand George Mason University, Department of Computer Science
R. Paul Wiegand George Mason University, Department of Computer Science
worst
R. Paul Wiegand George Mason University, Department of Computer Science