Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

•• socrat1ve

•• • Name
Date

Algo {OS0 5202 0) Quiz 1 Score

------- ·--·--- - -- - - - -
-I
1. Solve the recurrence T(n) = T(n/2) +1
@ O(n)
1-- [
@ O(nlog n)
'1?J'o(lo gn) =
@ O(n 2 )
L.
I
2. Solve the recurrence T(n) = 9T(n/3) +n
@ T(n) = Theta(n)

® T (n) = Theta (n 2)
© T(n) = Theta(log n)
T(n) = Theta(n log n)

3. In array arr(i) the integer value i represents


@ Condition
@ Marker

$1ndex
@ None of the above

4. An operation in an algorithm takes a fixed amount of time, so its time is bounded by


@ function
@const ant L
I

© variable
@ O(n)

I
S. Which of the following is correct?
@ 0(1)<0(1og n)<O(n togn)<O(n)<O(n 2)<0(n 3)<0(2")

@ 0(1)<0(n)< O(log n)<O(n logn)<O{n 2)<0(n 3).<0(2")

$ 0(1)<0(1og n)<O{n)<O(n logn)<O(n2 )<0(n 3 )<0(2")

@ 0(1)<0(Iog n)<O(n)<O{n logn)<O(n2)<0(2")<0 {n 3)


6. Solve the recurrence T(n) = T(n/2) + theta(1)
J:?f T(n) = Theta( log n)
@ T(n) = Theta( n log n)
© T(n) = Theta ( n)

@ T(n) = Theta(n 2)

7. If f(n) is 2n 2+theta(n) , then we can say that f(n) =


@ 0(1)

@ Theta(n 2)

~O(n)

@ Theta(1)

8. A recursion tree is drawn with cost of single call in each node, the running time is the sum of
costs in
$ A l l nodes
@ some nodes

© ·root nodes
@ leaf nodes

9. For a recusion tree, each node represent the cost of


~single subproblem

@ multiple sub problerr:1

© whole problem
@ none of the above

10. Typically the pseudocode is not concerned with the issues of


@ effectiveness
..
@ finiteness

© definiteness
~oftware engineering

You might also like