03-basic-complexity

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

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

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

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

View Full Document
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
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”

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

View Full Document
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
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”

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

View Full Document
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 Θ
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

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

View Full Document
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
Ask a homework question - tutors are online