

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!


a. State the definition of f ( n )= O ( g ( n )).
→ ∞ lim ( ( )/ ( )) , where 0 < L <∞.
then h 1 (^) ( n )⋅ h 2 ( n )=Θ( f ( n )⋅ g ( n )).
iff a > b. d. f ( n )+ o ( f ( n ))=Θ( f ( n )).
e
n n n
n ⋅ +^ Θ
n n
2 n (^) 4 n .
ProcessArray(A, p, r) (Preconditions: p ≥ 1 and r ≤ length [ A ])
p r q
Write a recurrence which gives the running time T ( n ) of this algorithm, when called on the full array A [ 1 n ]. Give a tight asymptotic solution to this recurrence.
WasteTime(n) (pre: n ≥ 1 )
Write a recurrence which gives the running time T ( n ) of this algorithm. Give a tight asymptotic solution to this recurrence.
a. T ( n )= 2 T ( n / 4 )+ n b. T ( n )= 7 T ( n / 3 )+ n^2
T n n
T n 3 / 3
n
n
n
Show that there exists a c > 0 such that T ( n )≤ cn lg n for all n ≥ 3. Prove this using induction on n ( not the Master Theorem.) (Note: this problem is a watered down substitution method, i.e. I'm giving you n 0 (namely 3), and you must determine c .)