This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: nodes is 2. The example is the tree (1 , 2) , (2 , 3) ,..., ( n1 ,n ). 2 (6 points) 2.1 Part (a) The recurrence relation is T ( n ) = T (3 n/ 4) + O ( n ) and T ( n ) = O ( n ) by master theorem. 2 2.2 Part (b) The recurrence relation is T ( n ) = 2 T ( n1)+ O (1) and T ( n ) = 2 n by induction. 2.3 Part (c) The recurrence relation is T ( n ) = 4 T ( n/ 2) + O ( n 2 ) and T ( n ) = n 2 log n by master theorem. 3 (9 points) 3.1 Part (a) S ( n ). 3.2 Part (b) S ( i ) = 10 , 8 , 18 , 33 , 26 , 36 , 56 , 66 , 60 , 70. 3.3 Part (c) S ( i ) = min { S ( j ) + h i : j < i and d id j ≤ M } . 3.4 Part (d) S (0) = 0; for i = 1 ...n S ( i ) = ∞ ; for i = 1 ...n for j = 0 ...i1 if d id j ≤ M and S ( j ) + h i < S ( i ) S ( i ) = S ( j ) + h i ; return S ( n ); 3.5 Part (e) O ( n 2 )....
View
Full Document
 Fall '09
 Freund,Yoav
 UCI race classifications, Planar graph, Recurrence relation, Spanning tree

Click to edit the document details