15121 Exam 1 Review: Spring 2011
Your lifelong friend Farmer John is in trouble! Farmer John has owned
his farm for years, thriving in Amish country. Last year, he won both
of Pennsylvania‟s most prestigious cattle farm awards, the Milk Milk
and Moo Moo awards for the best quality and most milk produced
produced on any farm in the country.
He is reputedly one of the
kindliest and most knowledgeable people around, and has made some
sizeable donations to charity. However, his evil twin brother , a.k.a.
“Fe
el
Good Jones” Jones is trying to steal away this years awards.
FeelGood Jones recently renounced the Amish life. After his twin
brother Farmer John let him win in a game of ping pong when he was
having a bad day, he decided he did not want to be pitied any longer.
FeelGood Jones betrayed his family, and got a computer and began to
implement some technology on his farm.
Farmer John then approached you for help. He had an idea: perhaps HE
couldn‟t touch technology
but maybe you can! Farmer John, though, is
actually an expert computer scientist . He wants to make sure you are
proficient with your big O notation before he takes you on as a
consultant
, so he‟
s given you a short quiz:
Big O
What do these running times look like in Big O notation?
O(__
)
Constant
O(___
)
Linear
O(___
)Logarithmic
O(____
) Quadratic
O(____
) Exponential
Put these run times in order of increasing amount of time:
______
< ______
<______
< ______
<< ______
What would be the running time if a logarithmic operation was performed a
linear number of times?
______________
What would be the running time if a quadratic operation was performed a
linear number of times?
______________
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentWhat would be the running time if a linear operation was performed a
logarithmic number of times and constant operation was performed a quadratic
number of times?
______________
Determine the running time of these functions.
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '09
 Big O notation, Analysis of algorithms, public void, Farmer John

Click to edit the document details