algorithm homewok

1
COMP 332 Assignment 2 due: Tuesday, September 15 Note: you may find the formulas in Appendix A to be helpful for this home- work. 1. Do Exercise 2.1.6. 2. Do Exercise 2.2.3. 3. Do Exercise 2.3.3 4. Do Exercise 2.3.4 5. Suppose there are two functions, f (n) and h(n) such that f (n) o(h(n)). Prove or disprove: There always exists a function g(n) such that f (n) o(g(n)) and g(n) o(h(n)). For example, with f (n)= n and h(n)= n 2 , we could pick g(n)= nlgn. (This might be too hard to solve in general. If so, give a reasonable simplification of the problem and solve the simpler form.) 1

Upload: phulam146

Post on 08-Dec-2015

215 views

Category:

Documents


3 download

DESCRIPTION

Algorithm sample homework

TRANSCRIPT

Page 1: Algorithm homewok

COMP 332Assignment 2

due: Tuesday, September 15

Note: you may find the formulas in Appendix A to be helpful for this home-work.

1. Do Exercise 2.1.6.

2. Do Exercise 2.2.3.

3. Do Exercise 2.3.3

4. Do Exercise 2.3.4

5. Suppose there are two functions, f(n) and h(n) such that f(n) ∈ o(h(n)).Prove or disprove: There always exists a function g(n) such that f(n) ∈o(g(n)) and g(n) ∈ o(h(n)). For example, with f(n) = n and h(n) = n2,we could pick g(n) = nlgn. (This might be too hard to solve in general.If so, give a reasonable simplification of the problem and solve the simplerform.)

1