03-basic-complexity

03-basic-complexity - CS 4102 Algorithms Chapter 2...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 4102, Algorithms: Chapter 2 • Measuring time complexity • Order classes: Big-Oh etc. • Proving order-class membership • Properties of order-classes • More on optimality (not in text) • Improving searching of lists • Binary Search: W(n), A(n) • Decision Trees for lower-bounds arguments
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Classifying functions by their Asymptotic Growth Rates • asymptotic growth rate, asymptotic order, or order of functions • Comparing and classifying functions that ignores constant factors and small inputs . • The Sets big oh O(g), big theta Θ (g), big omega Ω (g) g Ω (g): functions that grow at least as fast as g Θ (g): functions that grow at the same rate as g O (g): functions that grow no faster than g
Background image of page 2
The Sets O(g), Θ (g), Ω (g) • Let g and f be a functions from the nonnegative integers into the positive real numbers • For some real constant c > 0 and some nonnegative integer constant N 0 • O(g) is the set of functions f, such that f(n) c g(n) for all n N 0 Ω (g) is the set of functions f, such that f(n) c g(n) for all n N 0 Θ (g) = O(g) Ω (g) • asymptotic order of g • f ∈Θ (g) read as “f is asymptotic order g” or “f is order g”
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Asymptotic Bounds • The Sets big oh O(g), big theta Θ (g), big omega Ω (g) – remember these meanings: • O(g): functions that grow no faster than g, or asymptotic upper bound Ω (g): functions that grow at least as fast as g, or asymptotic lower bound Θ (g): functions that grow at the same rate as g, or asymptotic tight bound
Background image of page 4
Comparing asymptotic growth rates • Comparing f(n) and g(n) as n approaches infinity, • IF • < , including the case in which the limit is 0 then f O(g) • > 0, including the case in which the limit is then f Ω (g) • = c and 0 < c < then f Θ (g) • = 0 then f o(g) read as “little oh of g” • = then f ω (g) read as “little omega of g”
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Properties of O(g), Θ (g), Ω (g) • Transitive: If f O(g) and g O(h), then f O(h) O is transitive. Also Ω , Θ , o, ω are transitive. • Reflexive: f Θ (f) • Symmetric: If f Θ (g), then g Θ (f) Θ defines an equivalence relation on the functions. • Each set Θ (f) is an equivalence class (complexity class). • f O(g) g Ω (f) • O(f + g) = O(max(f, g)) similar equations hold for Ω and Θ
Background image of page 6
Classification of functions (1) • O(1) denotes the set of functions bounded by a constant (for large n) • f Θ (n), f is linear • f Θ (n 2 ), f is quadratic ; f Θ (n 3 ), f is cubic • lg n o(n α ) for any α > 0, including fractional powers
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 35

03-basic-complexity - CS 4102 Algorithms Chapter 2...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online