Assignment Computer Engineering CSE 555
Assignment Computer Engineering CSE 555
Analyze the time complexity (in most appropriate asymptotic notation) of the following
procedures by your solutions for the Homework 1:
I. Searching a product.
Attach the code of your solution for each part just before its analysis.
Part 2:
a) Explain why it is meaningless to say: “The running time of algorithm A is at least O(n2)”.
b) Let f(n) and g(n) be non-decreasing and non-negative functions. Prove or disprove
that: max(f (n), g(n)) = Θ(f(n) + g(n)).
I. 2n+1 = Θ(2n)
III. Let f(n)=O(n2) and g(n)= Θ(n2). Prove or disprove that: f(n) * g(n) = Θ(n4).
Part 3:
List the following functions according to their order of growth by explaining your assertions.
n1.01, nlog2n, 2n, √n, (log n)3, n2n, 3n, 2n+1, 5 log2 n, logn
Part 4:
Give the pseudo-code for each of the following operations for an array list that has n elements
and analyze the time complexity:
Analyze the time complexity and space complexity of the following code segments:
a)
b)
Int sum = 0
return sum
c)
d)
p_3(array, n)
else
}
RESTRICTIONS:
GENERAL RULES:
- For any question firstly use course news forum in Moodle, and then the contact TA.
- You can submit assignment one day late and will be evaluated over sixty percent (%60).
REPORT RULES:
GRADING :
- Part 1: 20 pts
- Part 2: 10 pts
- Part 3: 25 pts
- Part 4: 30 pts
- Part 5: 15 pts
- Disobey restrictions: -100
- Cheating: -200
- Your assignment is evaluated over 100 as your performance.
CONTACT :