Hw 2: Complexity
Hw 2: Complexity

 

Due Date: Friday, March 1, 2013, 23:59:59
Weight: 4%

You will submit your solution to this assignment to the Curator System (as HW2). Your solution must be either a plain text file or a PDF document; submissions in other formats will not be graded.
Except as noted, credit will only be given if you show relevant work.

1. Time Analysis

[30 points] Using the rules given in the course notes, perform an exact count complexity analysis, for the worst case, of the body of the following function. (Take the cost of list.length to be 2.)

2. Growth: input

[20 points] Problem 2.11 from the textbook.

An algorithm takes 0.5 ms for input size 100. How long will it take for input size 500 if the running time is the following (assume low-order terms are negilible).

  1. linear
  2. O( N log N )
  3. quadratic
  4. cubic

3. Growth: time

[20 points] Problem 2.12 from the textbook.

An algorithm takes 0.5 ms for input size 100. How large a problem can be solved in 1 minute if the running time is the following (assume low-order terms are negilible).

  1. linear
  2. O( N log N )
  3. quadratic
  4. cubic

 

4. Theta analysis

[30 points] For each part, determine the simplest possible function g(n) such that the given function is Θ(g) . The only justification required is for you to cite the Theta theorems from the notes that you applied.

  1. a(n) = 3n3 + 9n2 + 27n + 81
  2. b(n) = 8nlogn + 16n + 32logn + 64
  3. c(n) =  n  + logn
  4. d(n) = nlog(n2 ) + nlogn
  5. e(n)  =    7 + n2
    7n

 

 For manually graded assignments, only the student's last Curator/font> submission will be evaluated. There are no exceptions to this policy!

 

The CS 3114 programming projects are individual work. Each submission must be pledged by including the commented posted pledge in the submitted file. The Va Tech Honor Code is in effect for all submitted work in CS 3114.
"On my honor, I have neither given nor received unauthorized aid on this assignment."

 
Computer Science 3114 Data Structures and Algorithms
D. Barnette