This preview shows page 1. Sign up to view the full content.
Assignment #1:
Due September 2
1. Let
P
be a problem. The worstcase 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 worstcase time complexity
O
(
n
3
2
)
.
(b) A has worstcase time complexity
O
(
n
)
.
(c) A has worstcase 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 ) worstcase time, is it possible that it takes O ( n ) on some inputs? (b) If I prove that an algorithm takes Θ( n 2 ) worstcase 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. 31 (page 5758) 4. 32 (page 58) 1...
View
Full
Document
This note was uploaded on 09/18/2008 for the course CS 4349 taught by Professor Chandra during the Spring '08 term at University of Texas at Dallas, Richardson.
 Spring '08
 Chandra

Click to edit the document details