CNG315 Lecture2 InclassExercises
CNG315 Lecture2 InclassExercises
Topics: Algorithm Growth Rates, Common Growth Rates, Asymptotic Notation: Big-Theta, Big-O and Big-
Omega, Merge Sort Algorithm Analysis with Recursion Tree.
1. Order the following functions by growth rate: n, n2,logn, nlogn, sqrt(n), 2n, 7, n3
2. An algorithm takes 2 ms for input size 256. How long will it take for input size 1024 if the running
time is O (log n)?
4. Assume that each of the expressions below gives the processing time T(n) spent by an algorithm for
solving a problem of size n. Select the dominant term(s) having the steepest increase in n and
specify the lowest Big-Oh complexity of each algorithm.
0.01n + 100n2
2n + n0.5 + 0.5n1.25
Page 1 of 2
5. Are each of the following true or false?
References:
https://www.cs.auckland.ac.nz/courses/compsci220s1t/lectures/lecturenotes/GG-
lectures/220exercises1.pdf
https://www.cse.wustl.edu/~sg/CS241_FL99/hw1-practice.html
Page 2 of 2