This quiz is homework assignment #2. Any question you answered correctly in class are considered correct for the purposes of the assignment. Any question you did not answer or which you answered incorrectly is now a short answer question for the homework assignment due in class on Wednesday. We will hand back the graded quiz on Friday.
In italics are instructions on how to answer each question for homework. The correct letter answer is listed after each question.
Good luck!
Which of the following are listed in strictly increasing asymptotic order (i.e., the left function is asymptotically less than, or little-o, of the right function)?
Correct answer(s): (b)
Which of the following is an asymptotically-tight (i.e. big-) bound for the recurrence: T(n)=T(n/2)+1?
Correct answer(s): (c)
The following function is designed to make a computer user say that they see an albatross. It does this by asking them again and again until they go crazy and say that they do see one:
int Albatross(int n) If n=1 Then Return End If For i=1 to n Print ``Do you see the albatross now?'' End For Albatross(n/2)
Which of the following is an asymptotically-tight bound on the number of times the user would be asked about the albatross:
Correct answer(s): (b)
Consider the following recurrence relation:
Suppose we expand this equation k recursive times as we did in class (assume that the recurrence stated above is correct for k=1). Then, in general we would have which of the following?
Correct answer(s): (b)
A certain tree has a depth of d, a maximum branching factor of b, and n nodes total. Which of the following must be true of the tree?
Correct answer(s): (a)
Which of the following is not equal to 3?
Correct answer(s): (e)
Which best describes the siblings of u?
Correct answer(s): (b)
The Queue ADT can be briefly described as FIFO (First In First Out) and the Stack ADT as LIFO (Last In First Out). Which of these best describes the Priority Queue ADT?
Correct answer(s): (b)