Nathan Sprague
1/31/24
\[ \begin{align} \text{if} \;\;\; \lim_{n \to \infty} \frac{f(n)}{g(n)} \begin{cases} \in [0, \infty) , \;\;\; &f(n) \in O(g(n))\\ \in (0, \infty) , \;\;\; &f(n) \in \Theta(g(n))\\ \in (0, \infty] , \;\;\; &f(n) \in \Omega(g(n))\\ \end{cases} \end{align} \]
(Notice that multiple cases may be true.)
If \(\displaystyle \lim_{n \to \infty} f(n) = \lim_{n \to \infty} g(n) = \infty\) and \(f'(n)\) and \(g'(n)\) exist, then
\[\lim_{n \to \infty} \frac{f(n)}{g(n)} = \lim_{n \to \infty} \frac{f'(n)}{g'(n)}\]
The limit definitions often provide the easiest way to formally demonstrate the asymptotic relationship between two functions…
Using algebra and basic limit rules:
The limit definitions often provide the easiest way to formally demonstrate the asymptotic relationship between two functions…
Using L’Hôpital’s rule
public static boolean contains(int target, int[] numbers) {
for (int number : numbers) {
if (number == target) {
return true;
}
}
return false;
}