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
a6ddf2c7
Verified
Commit
a6ddf2c7
authored
4 weeks ago
by
orestis.malaspin
Browse files
Options
Downloads
Patches
Plain Diff
added 2025
parent
01e28902
No related branches found
No related tags found
No related merge requests found
Pipeline
#40451
passed
4 weeks ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
slides/cours_24.md
+10
-10
10 additions, 10 deletions
slides/cours_24.md
with
10 additions
and
10 deletions
slides/cours_24.md
+
10
−
10
View file @
a6ddf2c7
...
@@ -50,11 +50,13 @@ graph LR;
...
@@ -50,11 +50,13 @@ graph LR;
. . .
. . .
```
C
```
C
initialiser(graphe) // tous sommets sont non-visités
initialiser(graphe) // tous
les
sommets sont non-visités
pile =
visiter(sommet,
vid
e) //
sommet es
t un sommet du graphe
au hasard
visiter(sommet,
pil
e) //
on choisi
t un sommet du graphe
tant que !est_vide(pile)
tant que !est_vide(pile)
v = dépiler(pile)
dépiler(pile, (v,u))
pile = visiter(v, pile)
si u != visité
ajouter (v,u) à arbre T
visiter(u, pile)
```
```
## Que fait visiter?
## Que fait visiter?
...
@@ -62,15 +64,13 @@ tant que !est_vide(pile)
...
@@ -62,15 +64,13 @@ tant que !est_vide(pile)
. . .
. . .
```
C
```
C
pile
visiter(
sommet
, pile)
rien
visiter(
x
, pile)
s
omme
t =
visité
marquer x c
omme visité
pour
w =
chaque arête
de sommet
pour chaque arête
(x,w)
si w != visité
si w != visité
pile = empiler(pile, w)
empiler(pile, (x,w))
retourne pile
```
```
# Exercice
# Exercice
*
Établir la liste d'adjacence et appliquer l'algorithme de parcours en profondeur au graphe
*
Établir la liste d'adjacence et appliquer l'algorithme de parcours en profondeur au graphe
...
...
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