Refcard
O( g(n)) = { f (n) | ∃c ∈ R+ , ∃n0 ∈ N, ∀n ≥ n0 , 0 ≤ f (n) ≤ cg(n)} Ω( g(n)) = { f (n) | ∃c ∈ R+ , ∃n0 ∈ N, ∀n ≥ n0 , 0 ≤ cg(n) ≤ f (n)} Θ( g(n)) = { f (n) | ∃c1 ∈ R+ , ∃c2 ∈ R+ , ∃n0 ∈ N, ∀n ≥ n0 , 0 ≤ c1 g(n) ≤ f (n) ≤ c2 g(n)} f (n) = ∞ ⇐⇒ g(n) ∈ O( f (n)) et f (n) ∈ O( g(n)) n→∞ g ( n ) f (n) lim = 0 ⇐⇒ f (n) ∈ O( g(n)) et g(n) ∈ O( f (n)) n→∞ g ( n ) f (n) lim = c ∈ R+ ⇐⇒ f (n) ∈ Θ( g(n)) n→∞ g ( n ) lim f (n) ∈ O( g(n)) ⇐⇒ g(n) ∈ Ω( f (n)) f (n) ∈ Θ( g(n)) ⇐⇒ f (n) ∈ Ω( g(n)) g(n) ∈ Ω( f (n))
Ordres de grandeurs constante Θ(1) logarithmique Θ(log n) polylogarith. Θ((log n) ) √ Θ( n) c Théorème général
Soit à résoudre T (n) = aT (n/b) + f (n) avec a ≥ 1, b > 1
linéaire Θ(n) Θ(n log n) quadratique Θ(n2 ) Θ(nc ) c 2008 Alexandre D URET-L UTZ . License : Creative Commons [by-nc-sa]
– Si f (n) = O(nlogb a−ε ) pour un ε > 0, alors T (n) = Θ(nlogb a ). c > 1 – Si f (n) = Θ(nlogb a ), alors T (n) = Θ(nlogb a log n). – Si f (n) = Ω(nlogb a+ε ) pour un ε > 0, et si a f (n/b) ≤ c f (n) pour un c < 1 et tous les n suffisamment grands, alors T (n) = Θ( f (n)). (Note : il est possible de n’être dans aucun de ces trois cas.)
c>2 c>1 nœuds internes (ni ) hauteur de l’arbre (h) (nœuds n = ni + f ) Pour tout arbre binaire : n ≤ 2 h +1 − 1 f ≤ 2h si x = 1 si | x | < 1 si | x | < 1
Arbres x profondeur de x feuilles ( f ) h ≥ log2 (n + 1) − 1 = log2 n si n > 0 h ≥ log2 f si f > 0
exponentielle Θ(cn ) factorielle Θ(n!) Θ(nn )
Identités utiles n ( n + 1) ∑k= 2 k =0 x n +1 − 1 ∑ x = x−1 k =0 k k =0 ∞ n n
f = ni + 1 (si l’arbre est complet = les nœud internes ont tous 2 fils) Dans un arbre binaire équilibré une feuille est soit à la profondeur log2 (n + 1) − 1 soit à la profondeur log2 (n + 1) − 1 = log2 n . Pour ces arbres h = log2 n . Un arbre parfait (= complet, équilibré, avec toutes les feuilles du dernier niveau à gauche) étiqueté peut être représenté par un tableau. a Les indices sont reliés par : Père(y) = y/2 e b a b