diff --git a/slides/.gitignore b/slides/.gitignore index 2000f8a63a7707b72e472719255b506fcc21b692..311559fd6103ddbf587e46500afc3d3a06bb04d6 100644 --- a/slides/.gitignore +++ b/slides/.gitignore @@ -3,3 +3,4 @@ *.markdown *.html index.md +.puppeteer.json diff --git a/slides/cours_17.md b/slides/cours_17.md index fb4f1db96ecad75361f38d9d8821c78219fad39d..5210b2a1f015540c6481630afa10681516c1d3b6 100644 --- a/slides/cours_17.md +++ b/slides/cours_17.md @@ -1044,9 +1044,9 @@ lequel, pour chaque nœud, la différence de hauteur entre le sous-arbre gauche * Relation entre noeuds et hauteur: $$ -\log_2(1+N)\leq 1+H\leq 1.44\cdot\log_2(2+N),\quad N=10^5,\ 17\leq\leq 25. +\log_2(1+N)\leq 1+H\leq 1.44\cdot\log_2(2+N),\quad N=10^5,\ 17\leq H \leq 25. $$ -* Permet l'équilibrage en temps constant: insertion/suppression $\O(\log_2(N))$. +* Permet l'équilibrage en temps constant: insertion/suppression $O(\log_2(N))$. # Notation @@ -1162,6 +1162,8 @@ graph TD; style id4 fill:#fff,stroke:#fff ``` +* `fe = -1` + :::: ::: @@ -1207,6 +1209,8 @@ graph TD; style id5 fill:#fff,stroke:#fff ``` +* `fe = 0` + :::: ::: @@ -1265,3 +1269,52 @@ graph TD; ::: **Déséquilibre!** Que vaut `fe`? + +. . . + +* `fe = 2` + +# Les cas de déséquilibre + + +::: columns + +:::: column + +## Cas 1a + +```{.mermaid format=pdf width=400 loc=figs/} +graph TD; + id0((B))-->id1((A)); + id0-->id2[/w\]; + id1-->id3[/u\]; + id1-->id4[/v\]; + id4-->id5(( )); + id4-->id6(( )); + style id5 fill:#fff,stroke:#fff + style id6 fill:#fff,stroke:#fff +``` + +:::: + +:::: column + +. . . + +* `hd > hg` + +```{.mermaid format=pdf width=400 loc=figs/} +graph TD; + id0((A))-->id1((B)); + id0-->id2[/u\]; + id1-->id3[/v\]; + id1-->id4[/w\]; + id2-->id5(( )); + id2-->id6(( )); + style id5 fill:#fff,stroke:#fff + style id6 fill:#fff,stroke:#fff +``` + +:::: + +:::