Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cours
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
algorithmique
cours
Commits
4fa8d268
Commit
4fa8d268
authored
3 years ago
by
pierre.kunzli
Committed by
orestis.malaspin
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Pk
parent
295b1052
Branches
Branches containing commit
No related tags found
1 merge request
!5
Pk
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
slides/cours_16.md
+4
-1
4 additions, 1 deletion
slides/cours_16.md
slides/cours_18.md
+7
-5
7 additions, 5 deletions
slides/cours_18.md
with
11 additions
and
6 deletions
slides/cours_16.md
+
4
−
1
View file @
4fa8d268
...
@@ -270,9 +270,10 @@ arbre suppression(arbre, clé)
...
@@ -270,9 +270,10 @@ arbre suppression(arbre, clé)
```
```
# Il nous manque le code pour le `parent`
# Il nous manque le code pour le `parent`
## Pseudo-code pour trouver le parent (5min -> matrix)
## Pseudo-code pour trouver le parent (5min -> matrix)
. . .
```
```
arbre parent(arbre, sous_arbre)
arbre parent(arbre, sous_arbre)
si est_non_vide(arbre)
si est_non_vide(arbre)
...
@@ -296,6 +297,8 @@ arbre parent(arbre, sous_arbre)
...
@@ -296,6 +297,8 @@ arbre parent(arbre, sous_arbre)
## Pour un seul enfant (5min -> matrix)
## Pour un seul enfant (5min -> matrix)
. . .
```
```
arbre suppression(arbre, clé)
arbre suppression(arbre, clé)
sous_arbre = position(arbre, clé)
sous_arbre = position(arbre, clé)
...
...
This diff is collapsed.
Click to expand it.
slides/cours_18.md
+
7
−
5
View file @
4fa8d268
...
@@ -447,7 +447,7 @@ arbre rotation_gauche(arbre P)
...
@@ -447,7 +447,7 @@ arbre rotation_gauche(arbre P)
si est_non_vide(P)
si est_non_vide(P)
Q = droite(P)
Q = droite(P)
droite(P) = gauche(Q)
droite(P) = gauche(Q)
gauche(Q) =
droite(P)
gauche(Q) =
P
retourne Q
retourne Q
retourne P
retourne P
```
```
...
@@ -461,7 +461,7 @@ arbre rotation_gauche(arbre P)
...
@@ -461,7 +461,7 @@ arbre rotation_gauche(arbre P)
si est_non_vide(P)
si est_non_vide(P)
Q = droite(P)
Q = droite(P)
droite(P) = gauche(Q)
droite(P) = gauche(Q)
gauche(Q) =
droite(P)
gauche(Q) =
P
retourne Q
retourne Q
retourne P
retourne P
```
```
...
@@ -492,7 +492,7 @@ tree_t rotation_left(tree_t tree) {
...
@@ -492,7 +492,7 @@ tree_t rotation_left(tree_t tree) {
if (NULL != tree) {
if (NULL != tree) {
subtree = tree->right;
subtree = tree->right;
tree->right = subtree->left;
tree->right = subtree->left;
subtree->lefe;
subtree->lef
t = tre
e;
}
}
return subtree;
return subtree;
}
}
...
@@ -502,6 +502,8 @@ tree_t rotation_left(tree_t tree) {
...
@@ -502,6 +502,8 @@ tree_t rotation_left(tree_t tree) {
*
Et la rotation à droite (5min)?
*
Et la rotation à droite (5min)?
. . .
```
C
```
C
tree_t rotation_right(tree_t tree) {
tree_t rotation_right(tree_t tree) {
tree_t subtree = NULL;
tree_t subtree = NULL;
...
@@ -578,9 +580,9 @@ graph TD;
...
@@ -578,9 +580,9 @@ graph TD;
# Exercices
# Exercices
## Faire l'implémentation de la double rotation (pas corrigé
1
5min)
## Faire l'implémentation de la double rotation (pas corrigé
,
5min)
. . .
# Exercices
::: columns
::: columns
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment