Exam 1 Sample Questions
log_2 8 = ?
log_b a * log_a b = ?
What does it mean to say that f(n) dominates g(n)?
f(n) = 3n^2 + 2n + 13
f(n) is in O(?)
Is f(n) = sqrt(n^5) in O(n^2)?
How does Big-Theta differ from Big-O?
If f(n) is in O(n) and g(n) is in O(n),
then (f(n) - g(n) ) in O(?)?
Give a running time (T_n) for the following code fragment :
for (int i = 0; i < n ; i ++){ for (int j=0; j < n; j++){ loop body } }
T_n = 4T(n/3) + n^2. Solve for the asymptotic running time using the "Master Method".
Write the pop() method for the contiguous-memory implementation of a stack.