This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: number of comparisons is six. Figure 1: Finding the median of ﬁve numbers 1 3. The recurrence is deﬁned as following: T ( n ) = ( O (1) if n < = 9 T ‡ 2 n 3 · + T ‡ n 3 · + cn otherwise where c is a positive constant. We solve this recursion by induction. Assume that T ( n ) ≥ dn lg n , when n ≤ k and d is a positive constant. As a base case, when n = 9, we take a hidden constant for O (1) as C such that C ≥ 9 d lg 9. Then, for n = k + 1, T ( k + 1) ≥ T ‡ 2( k + 1) 3 · + T ‡ ( k + 1) 3 · + c ( k + 1) ≥ d ‡ 2( k + 1) 3 · lg ‡ 2( k + 1) 3 · + d ‡ ( k + 1) 3 · lg ‡ ( k + 1) 3 · + c ( k + 1) = d ‡ 2( k + 1) 3 · (lg( k + 1)lg 3 2 ) + d ‡ ( k + 1) 3 · (lg( k + 1)lg 3) + c ( k + 1) = d ( k + 1)lg( k + 1)d ‡ 2( k + 1) 3 lg 3 2 + k + 1 3 lg 3 · + c ( k + 1) = d ( k + 1)lg( k + 1)d ( k + 1)(lg 32 3 ) + c ( k + 1) ≥ d ( k + 1)lg( k + 1) . Therefore, this recurrence belongs Ω( n lg n ) as long as d ≤ c log 32 / 3 . 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.
 Spring '08
 Unkown
 Algorithms

Click to edit the document details