Unformatted text preview: A { x } = { 1 , 3 , 4 } , y = 4, Pr ( y ≥ x ) = 1 Case 3: x = 3, A { x } = { 1 , 2 , 4 } , y = 4, Pr ( y ≥ x ) = 1 Case 4: x = 4, A { x } = { 1 , 2 , 3 } , y = 3, Pr ( y ≥ x ) = 0 So, we know that Pr ( y ≥ x ) = 0 if x is maximal among all n numbers, otherwise Pr ( y ≥ x ) = 1. Also, Pr ( y < x ) = 1Pr ( y ≥ x ), Thus, we have ∑ ∀ x [ Pr ( y ≥ x )(1) + Pr ( y < x )( n )] = 1 + 1 + 1 .... + 1 + n = ( n1)(1) + n = 2 n1 T ( n ) = T ( n1) + 1 n ∑ ∀ x [ Pr ( y ≥ x )(1) + Pr ( y < x )( n )] T ( n ) = T ( n1) + 1 n (2 n1) T ( n ) < T ( n1) + 2 T ( n ) = O ( n ) c ± 2006 Chung Kai Lun Peter. Comments are welcomed. Email: [email protected] 1...
View
Full Document
 Spring '10
 may
 English, Analysis of algorithms, Computational complexity theory, Best, worst and average case, Chung Kai Lun Peter, RandM ax

Click to edit the document details