ok formule math
This commit is contained in:
@@ -74,24 +74,20 @@ Soit un tableau de taille 𝑛.
|
||||
|
||||
Si on « coupe » ce tableau en deux parts égales, cela revient à diviser 𝑛 par deux à chaque itération :
|
||||
|
||||
<img src="https://render.githubusercontent.com/render/math?math=n_1=\frac{n}{2}>
|
||||
$$
|
||||
n_2 = \frac {n_1}{2}
|
||||
$$
|
||||
<img src="https://render.githubusercontent.com/render/math?math=n_1=\frac{n}{2}">
|
||||
|
||||
$$
|
||||
n_3 = \frac {n_2}{2}
|
||||
$$
|
||||
<img src="https://render.githubusercontent.com/render/math?math=n_2=\frac{n_1}{2}">
|
||||
|
||||
<img src="https://render.githubusercontent.com/render/math?math=n_3=\frac{n_2}{2}">
|
||||
|
||||
|
||||
|
||||
***Important*** : la taille d’un tableau étant forcément un *nombre entier*, 𝑛𝑖 va devenir à un moment ou un autre égal à 1.
|
||||
|
||||
Cela signifiera qu’après avoir divisé 𝑛 par 2 un nombre de fois égal à un certain nombre 𝑎, le tableau ne comportera plus qu’une seule valeur (et par conséquent l’algorithme s’arrête).
|
||||
$$
|
||||
n_i=1=\frac {n}{2×2×2…×2}=\frac {𝑛}{2𝑎}
|
||||
|
||||
$$
|
||||
<img src="https://render.githubusercontent.com/render/math?math=n_i=1=\frac{n}{2*2*...*2}=\frac{n}{2a}">
|
||||
|
||||
Soit : 𝑎 =log<sub>2</sub>(𝑛)
|
||||
|
||||
La recherche dichotomique est donc de complexité ***logarithmique***.
|
||||
|
||||
Reference in New Issue
Block a user