Skip to content
Snippets Groups Projects
Verified Commit a89e920c authored by orestis.malaspin's avatar orestis.malaspin
Browse files

added beginning of algo for balance

parent acbaf09e
Branches bedran_exercise-list
No related tags found
No related merge requests found
......@@ -3,3 +3,4 @@
*.markdown
*.html
index.md
.puppeteer.json
......@@ -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
```
::::
:::
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment