Home > SparkNotes > Computer Science Study Guides > Efficiency >

sparknotes

Searches: Efficiency


Problems

Problem : Define "Big-O notation".


Problem : Prove that the function $f(n) = n^2 + 3n + 1$ is $O(n^2)$.


Problem : You are given two functions, one which has an average case running time of $O(n^2)$ and the other which has an average running time of $O(n log n)$. In general, which would you choose?


Problem : True or false: A function with $O(n)$ efficiency will always run faster than a function with $O(n^2)$ efficiency?


Problem : Draw a graph showing how $n$, $log n$, $n^2$, and $2^n$ compare as $n$ increases.