PR3 - T ( n ± ) ≤ T ( n ) ≤ T ( n ±± ) 1. a...

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

View Full Document Right Arrow Icon
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
Background image of page 1

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

View Full DocumentRight Arrow Icon
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;
Background image of page 2
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 &lt; 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 &gt; 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

Page1 / 2

PR3 - T ( n ± ) ≤ T ( n ) ≤ T ( n ±± ) 1. a...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online