# HW1_sol - n cells You can ﬁnd the leftmost cell in O n...

This preview shows page 1. Sign up to view the full content.

Fall Semester 2008 CS300 Algorithms Solution #1 1. O ( 2 n ) O ( n + 10) O ( n 2 log n ) O ( n 2 . 5 ) O (10 n ) O (100 n ) 2. (a) False; Take f ( n ) = 2 n and g ( n ) = n . (b) True; Since f ( n ) = O ( g ( n )), there exist some c 0 R + and some n 0 N such that f ( n ) c 0 g ( n ) for all n n 0 . By noticing that f ( n ) and g ( n ) are functions with nonnegative real values, f ( n ) 2 c 0 g ( n ) f ( n ) c 2 0 g ( n ) 2 . Therefore, there always exist c = c 2 0 and n 0 such that f ( n ) 2 cg ( n ) 2 for all n n 0 . 3. Let us denote by V computing the Voronoi diagram of a given set P and by S sorting problem. To show that the lower bound of V is Ω( n log n ), you need to prove that S can be transformed to V in O ( n ). To do that, you have to ﬁnd a solution of V after modifying the input of S into that of V and transform it to the adequate solution of S . Since the input of S is [ x 1 , x 2 , ··· , x n ] and the one of V is [( x 1 , y 1 ) , ( x 2 , y 2 ) , ··· ( x n , y n )], you can map each x i to ( x i , 0) in O ( n ). After computing V with this transformed input, we are given the Voronoi diagram which consists of
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: n cells. You can ﬁnd the leftmost cell in O ( n ). Then by visiting a cell next to the current one and reporting x-coordinate of the site of the cell, you can obtain the solution of S , [ x i 1 , x i 2 , ··· , x i n ] in O ( n ). Therefore S ∝ O ( n ) V and the lower bound L V of V is the following: L V = Ω( n log n )-O ( n ) = Ω( n log n ) [ x 1 , x 2 , · · · x n ] ( x i 1 , 0) ( x i 2 , 0) ( x i n , 0) [( x 1 , 0) , ( x 2 , 0) , · · · ( x n , 0)] O ( n ) O ( n ) [ x i 1 , x i 2 , · · · x i n ] Input of sorting problem Output of sorting problem Compute the Voronoi diagram Walk around to the next cells and report x-coordinates. Figure 1: Lower bound of computing the Voronoi diagram 1...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online