Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| courses:cs211:winter2018:journals:boyese:chapter2 [2018/02/05 20:31] – [Section 2.3 : Implementing the Stable Matching Algorithm Using Lists and Arrays] boyese | courses:cs211:winter2018:journals:boyese:chapter2 [2018/02/05 20:31] (current) – [Section 2.2 : Asymptotic Order of Growth] boyese | ||
|---|---|---|---|
| Line 12: | Line 12: | ||
| In the previous section, we defined efficiency based on an algorithm' | In the previous section, we defined efficiency based on an algorithm' | ||
| \\ | \\ | ||
| - | **Asymptotic Upper Bounds**\\ | + | ===Asymptotic Upper Bounds=== |
| Let T(n) be a function. Given some other function f(n), we say that T(n) is O(f(n)) if for sufficiently large n, the function T(n) is bounded above by a constant multiple of f(n), or T(n) = O(f(n)). Specifically, | Let T(n) be a function. Given some other function f(n), we say that T(n) is O(f(n)) if for sufficiently large n, the function T(n) is bounded above by a constant multiple of f(n), or T(n) = O(f(n)). Specifically, | ||
| \\ | \\ | ||
| Line 18: | Line 18: | ||
| Consider an algorithm whose running time has the form T(n) = pn< | Consider an algorithm whose running time has the form T(n) = pn< | ||
| - | **Asymptotic Lower Bounds**\\ | + | ===Asymptotic Lower Bounds=== |
| We want to show that this upper bound is the best one possible. To do this, we want to express the notion that for arbitrarily large input sizes n, the function T(n) is at least a constant multiple of some specific function f(n). Thus, we say that T(n) is Ω(f(n)) if there exist constants ε > 0 and n< | We want to show that this upper bound is the best one possible. To do this, we want to express the notion that for arbitrarily large input sizes n, the function T(n) is at least a constant multiple of some specific function f(n). Thus, we say that T(n) is Ω(f(n)) if there exist constants ε > 0 and n< | ||
| - | **Asymptotically Tight Bounds**\\ | + | ===Asymptotically Tight Bounds=== |
| If a function T(n) is both O(f(n)) and Ω(f(n)), we say that T(n) is Θ(f(n)). In this case, we say that f(n) is an asymptotically tight bound for T(n). For example, the analysis above shows that T(n) = pn< | If a function T(n) is both O(f(n)) and Ω(f(n)), we say that T(n) is Θ(f(n)). In this case, we say that f(n) is an asymptotically tight bound for T(n). For example, the analysis above shows that T(n) = pn< | ||
| \\ | \\ | ||
| - | **Properties of Asymptotic Growth Rates**\\ | + | ===Properties of Asymptotic Growth Rates=== |
| **// | **// | ||
| If a function f is asymptotically upper-bounded by a function g, and if g in turn is asymptotically upper-bounded by a function h, then f is asymptotically upper-bounded by h.\\ | If a function f is asymptotically upper-bounded by a function g, and if g in turn is asymptotically upper-bounded by a function h, then f is asymptotically upper-bounded by h.\\ | ||
| Line 37: | Line 37: | ||
| Suppose that f and g are two functions (taking non-negative values) such that g = O(f). Then f + g = Θ(f). In other words, f is an asymptotically tight bound for the combined function f + g.\\ | Suppose that f and g are two functions (taking non-negative values) such that g = O(f). Then f + g = Θ(f). In other words, f is an asymptotically tight bound for the combined function f + g.\\ | ||
| \\ | \\ | ||
| - | **Asymptotic Bounds for Some Common Functions**\\ | + | ===Asymptotic Bounds for Some Common Functions=== |
| **// | **// | ||
| Let f be a polynomial of degree d, in which the coefficient a< | Let f be a polynomial of degree d, in which the coefficient a< | ||
