Problem Set 2
Explore practical problems to assess your understanding of formal tools for algorithm analysis. Learn to evaluate time complexity for various code snippets and clarify common misconceptions in algorithm growth and performance.
We'll cover the following...
We'll cover the following...
Question 1
Suppose your friend discovers a new algorithm and in his excitement tells you that his algorithm has a lower bound of O(n2). Can you explain why your friend's statement makes no sense?
Question 2
Does O(22n) equal O(2n) ?Question 3
Give an example of an algorithm whose best case is equal to its worst case?
Question 4
Work out the time complexity for the algorithm given below:
void ...