Asymptotic Analysis - rFronteddu/general_wiki GitHub Wiki
This is a means of discussing the general efficiency of an algorithm. When discussing time complexity of an algorithm, we use a positive integer to represent the size of the dataset it processes. To evaluate the actual algorithm, we must ignore machine-dependent constants (i.e., think about the number of instructions being executed, not about how fast a certain machine can execute them) and look at its growth rate as b approaches $\infty$.
At a very basic level, you need to think about how many instructions your algorithm must execute in the best and worst case scenarios when processing n pieces of data.
Then determine the function(s) that your algorithm is bounded above and below by, disregarding any leading constants or lower-order terms. Basically, you don't hang on to anything that doesn't directly impact the growth rate of f(n) and you only want to retain the term that has the greatest impact on growth rate
f(n) = Θ(g(n))
f(n) is Theta of g(n) if and only if there exists some positive constants $c_1, c_2$, and $n_0$ such that $c_1 * g(n) \leq f(n) \leq c_2 * g(n)$ whenever $n > n_0$
In short, f(n) is bounded both above and below by g(n) because after some point $n_0$ f(n) and g(n) have the same growth rate.
f(n) = O(g(n))
f(n) is "big O" of g(n) if and only if there exists some positive constants $c$, and $n_0$ such that f(n) $\leq c * g(n)$ whenever $n > n_0$
In short, f(n) is bounded above by g(n) because after some point $n_0$ g(n) always grows at a larger asymptotic growth rate than f(n)
f(n) = Ω(g(n))
f(n) is "big Omega" of g(n) if and only if there exists some positive constants $c$, and $n_0$ such that $ c * g(n) $\leq f(n)$ whenever $n > n_0$
In short, f(n) is bounded below by g(n) because after some point $n_0$ g(n) always grows at a smaller asymptotic growth rate than f(n)
Θ(1)
The term Θ(1) time, or "constant time", is used to refer to fundamental operations that take a constant amount of time to execute (e.g., reading a single value, performing a comparison between two values, checking a condition, etc.).