# a1 - (a If I prove that an algorithm takes Θ n 2...

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

Assignment #1: Due September 2 1. Let P be a problem. The worst-case time complexity of P is O ( n 2 ) . The worst case time complexity of P is also Ω( n lg n ) . Let A be an algorithm that solves P . Which subset of the following statements are consistent with this information about the complexity of P ? BrieFy explain your answer. (a) A has worst-case time complexity O ( n 3 2 ) . (b) A has worst-case time complexity O ( n ) . (c) A has worst-case time complexity Θ( n 2 ) . 2. ±or each of these questions, brieFy explain your answer.
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (a) If I prove that an algorithm takes Θ( n 2 ) worst-case time, is it possible that it takes O ( n ) on some inputs? (b) If I prove that an algorithm takes Θ( n 2 ) worst-case time, is it possible that it takes O ( n ) on all inputs? (c) Consider the function: f ( n ) = 100 n 2 20 n 2 − n n even n odd Is f ( n ) = Θ( n 2 ) ? Give reasons. 3. 3-1 (page 57-58) 4. 3-2 (page 58) 1...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online