PR3 - T n ± ≤ T n ≤ T n ±± 1 a< c from the theorem...

This preview shows pages 1–2. Sign up to view the full content.

Theorem 1. Let a, b, c, d R . Then the solution to the recurrence equation T ( n ) = b if n = 1 aT ( n/c ) + dn if n > 1 for n = c k is the following: T ( n ) = O ( n ) if a < c O ( n log n ) if a = c O ( n log c a ) if a > c And theorem holds even if n ± = c k . Proof. For n = c k , T ( n ) = aT ( n/c ) + dn = a [ aT ( n/c 2 ) + d · n/c ] + dn = ··· = a k T (1) + a k - 1 d ( n/c k - 1 ) + ··· + a 0 d ( n/c 0 ) max( b, d ) n k X i =0 a c · i . 1. a < c , then k X i =0 a c · i X i =0 a c · i converges. thus, T ( n ) = O ( n ) . 2. a = c , then from n = c k , k = log n log c thus, T ( n ) = O ( n log n ) . 3. a > c , then max( b, d ) n k X i =0 a c · i = max( b, d ) n a c · 1+log c n - 1 a c - 1 . Cn a c · 1+log c n = C ± a log c n . thus, T ( n ) = O ( n log c a ) . 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Now, let us assume that n ± = c k . Then we consider n ± , n ±± such that c k = n ± n n ±± = c k +1 . Note that a, b, c, d are all positive, T ( n ) is not a decreasing function;
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: T ( n ± ) ≤ T ( n ) ≤ T ( n ±± ) 1. a < c , from the theorem T ( n ± ) = O ( n ± ) , T ( n ±± ) = O ( n ±± ) . ∴ T ( n ) = O ( n ) . 2. a = c , T ( n ± ) = O ( n ± log n ± ) T ( n ±± ) = O ( n ±± log n ±± ) . ∴ T ( n ) = O ( n log n ) . 3. a > c , T ( n ± ) = O ( n ± log c a ) , T ( n ±± ) = O ( n ±± log c a ) . ∴ T ( n ) = O ( n log c a ) . Therefore for any n , above theorem holds. 2...
View Full Document

This note was uploaded on 02/04/2010 for the course COMPUTER S cs300 taught by Professor Unkown during the Spring '08 term at Korea Advanced Institute of Science and Technology.

Page1 / 2

PR3 - T n ± ≤ T n ≤ T n ±± 1 a< c from the theorem...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online