CS 361: Algorithms and Data Structures
Homework 2
Due date: Monday 9/12 in class


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. On the front page of your assignment, please write down the definition of Big-Θ for your reference.


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

  2. Suppose an algorithm performs f(n) = lg(n) + n operations on an input of size n.
    Show that f(n) is Θ(n)

  3. Let f(n) and g(n) be asymptotically non-negative functions. This means that, after some point, both f(n) and g(n) are guaranteed to return non-negative values. Use the definition of Big-Θ to show that the function max(f(n), g(n)) is Θ(f(n)+g(n))

  4. Algorithm Design 2.6
  5. I realized that the wording for question 2.6 is not as precise as it could be. In particular, part (a) says "give a bound" whereas part (b) says "show a bound". For both part (a) and part (b), please *prove* that your bound holds. In other words, go through the same process you did for question 1 and 2. This way, when you're done, you'll have actually proven a Big-Θ bound.

    Also, for part (c), when it says "give an algorithm" what that means is to write your own pseudocode for the problem. Your pseudocode should be asymptotically better than the pseudocode in the book.


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