130 likes | 140 Views
Algorithms CSCI 235 , Fall 2019 Lecture 3 Asymptotic Analysis. O notation--No faster than. We use:. to mean:. Roughly: f(n) is at most as big as g(n) or: f <= g. Examples. True or false? 23n 2 + 17n - 12 = O(n 2 ) b) n 3 = O(n 2 ). Strictly less than. if.
E N D
O notation--No faster than... We use: to mean: Roughly: f(n) is at most as big as g(n) or: f <= g
Examples True or false? • 23n2 + 17n - 12 = O(n2) b) n3 = O(n2)
Strictly less than if Roughly: f(n) is way smaller than g(n) or: f < g
Examples True or false? • n2 = o(n3) b) 2n2 + 2n + 1 = o(n2)
W notation--No slower than... Roughly: f(n) is at least as big as g(n) or: f >= g
Examples True or false? • 23n2 + 17n -12 = W(n2) • n3 = W(n2)
w notation: strictly greater than if Roughly: f(n) is way bigger than g(n) or: f > g
Examples True or false? • n3 = w(n2) • n! = w(2n)
Q notation--Just right... Roughly: f(n) is about the same as g(n) or: f = g
Examples True or false? • 23n2 + 17n - 12 = Q(n2)
Summary Say that f is: Notation Approximately Loosely little omega g f=w(g) f is way bigger than g f>g omega g f=W(g) f is at least as big as g f>=g theta g f=Q(g) f is about the same as g f=g oh g f=O(g) f is at most as big as g f<=g little oh g f=o(g) f is way smaller than g f<g