CS 361: Algorithms and Data Structures
Homework 2


Assignments will be collected at the beginning of the class period. Please bring a hardcopy to turn in. Your assignment can be hand-written or typed.


  1. Suppose an algorithm performs T(n) = 3(n+5)2 + n operations on an input of size n.
    Show that T(n) is Θ(n2)

  2. Suppose an algorithm performs T(n) = lg(n) + n operations on an input of size n.
    Show that T(n) is Θ(n). Be careful with your analysis.

  3. Suppose that T1(n) is O(f(n)) and T2(n) is also O(f(n)) for some function f(n). Is it true that T1(n) is O(T2(n))? If so, prove this statement using the definition of Big-O. If not, provide a counterexample.

  4. Suppose that T1(n) is Θ(f(n)) and T2(n) is also Θ(f(n)) for some function f(n). Is it true that T1(n) is Θ(T2(n))? If so, prove this statement using the definition of Big-Θ. If not, provide a counterexample.

  5. Algorithm Design 2.6 parts (a) and (c)
  6. The wording for question 2.6 is not as precise as it could be. In particular, part (a) says "give a bound". Please *prove* that your bound holds. That is, find a c and n0 that fulfill the definition for Big-O.

    Also, part (c) says "give an algorithm". Read the "Homework Guide" so you know what your answer must include.


Last modified: Fri Jan 24 10:58:47 PST 2014