Cont...

Assignment 1

Consider the following two functions g1[n]= n^ 3 , for * 0 <= n <= 10000 \\ n^ 2 ,for n>10,000

g2[n]= n, for * 0 <= n <= 100 \\ n^ 3 ,for n>100

Which one of the following are true?

a) g1(n) is O[g * 2[n]]

b) g1(n) is O[n ^ 3]

c) g2(n) is O[g * 1[n]]

d) g2(n) is O[n]

43

p

ossible answers:

b) g1(n) is O[n ^ 3]

d) g2(n) is O[n]