You are on page 1of 14

1

2
3
4
7
5
8
9
6
Affichage :


Explications :

On parcourt larbre de la racine vers les
feuilles.

Le parcours commence donc par le
noeud 1.




Parcours infixe de larbre
1
2
3
4
7
5
8
9
6
Affichage :


Explications :

Le noeud 1 possde un sous-graphe
gauche.

Avec un parcours infixe, on traite le
sous-graphe gauche avant le noeud
courant.

Le noeud courant devient le noeud 2.




Parcours infixe de larbre
1
2
3
4
7
5
8
9
6
Affichage :


Explications :

Le noeud courant est le noeud 2.

Pour la mme raison, le noeud courant
va devenir le noeud 4.




Parcours infixe de larbre
1
2
3
4
7
5
8
9
6
Affichage :
4

Explications :

Le noeud courant est le noeud 4.

Le noued 4 na pas de sous-graphe
gauche.

Avec un parcours infixe, le noeud
courant est trait avant son sous-graphe
droit.

Par consquent, on affiche le noeud 4.


Parcours infixe de larbre
1
2
3
4
7
5
8
9
6
Affichage :
4

Explications :

Le noeud 4 affich.

Avec le parcours infixe, on parcourt
prsent le sous-graphe droit du noeud
courant.

Le noeud 5 devient le noeud courant.

Le noued 5 possde un sous-graphe
gauche.

Parcours infixe de larbre
15
2
3
4
7
5
8
9
6
Affichage :
4, 7
Explications :

Le noeud 7 est le noeud courant.

Il na pas de sous-graphe gauche.

Par consquent, on affiche le noeud 7.

Le noeud 7 na pas de sous-graphe
droit.

Le noeud 5 devient le noeud coruant.
Parcours infixe de larbre
15
2
3
4
7
5
8
9
6
Affichage :
4, 7, 5
Explications :

Le noeud 5 est le noeud courant.
Le sous-graphe gauche a t explor.

Daprs le parcours infixe, on traite le
noeud courant avant son sous-graphe
droit.

Par consquent, on affiche le noeud 5.

On explore le sous-graphe droit.
Parcours infixe de larbre
15
2
3
4
7
5
8
9
6
Affichage :
4, 7, 5, 8
Explications :

Le noeud 8 est le noeud courant.

Ce noeud na pas de sous-graphe
gauche.

Par consquent, on affiche le noeud 8.

Le noeud 8 na pas de sous-graphe droit.
On retourne au noeud 2.
Parcours infixe de larbre
1
2
3
4
7
5
8
9
6
Affichage :
4, 7, 5, 8, 2
Explications :

Le noeud 2 est le noeud courant.
Son sous-graphe gauche a t explor.

Daprs infixe, on traite le noeud
courant avant son sous-graphe droit.

Par consquent, on affiche le noeud 2.

Le noeud 2 na pas de sous-graphe droit.
On retourne au noeud 1.
Parcours infixe de larbre
1
2
3
4
7
5
8
9
6
Affichage :
4, 7, 5, 8, 2, 1
Explications :

Le noeud 1 est le noeud courant.
Son sous-graphe gauche a t explor.

Daprs infixe, on traite le noeud
courant avant son sous-graphe droit.

Par consquent, on affiche le noeud 1.

On explore le sous-graphe droit du
noeud 1.
Parcours infixe de larbre
1
2
3
4
7
5
8
9
6
Affichage :
4, 7, 5, 8, 2, 1, 3
Explications :

Le noeud 3 est le noeud courant.
Il na pas de sous-graphe gauche.

Daprs infixe, on traite le noeud
courant avant son sous-graphe droit.

Par consquent, on affiche le noeud 3.

On explore le sous-graphe droit du
noeud 3.
Parcours infixe de larbre
1
2
3
4
7
5
8
9
6
Affichage :
4, 7, 5, 8, 2, 1, 3
Explications :

Le noeud 6 est le noeud courant.

Daprs infixe, on traite le noeud
courant aprs son sous-graphe gauche.

Par consquent, le noeud courant
devient le noeud 9.

Parcours infixe de larbre
1
2
3
4
7
5
8
9
6
Affichage :
4, 7, 5, 8, 2, 1, 3, 9
Explications :

Le noeud 9 est le noeud courant.

Il na pas de sous-graphe gauche.

Daprs le parcours infixe, on traite le
noeud courant avant le sous-graphe
droit.

Par consquent, on affiche le noeud 9.

Le noeud 9 na pas de sous-graphe droit.
Le noued 6 redevient le noeud courant.

Parcours infixe de larbre
1
2
3
4
7
5
8
9
6
Affichage :
4, 7, 5, 8, 2, 1, 3, 9, 6
Explications :

Le noeud 6 est le noeud courant.

Son sous-graphe gauche a t explor.

Daprs le parcours infixe, on traite le
noeud courant avant le sous-graphe
droit.

Par consquent, on affiche le noeud 6.

Le noeud 6 na pas de sous-graphe droit.
Fin de lexploration du graphe.

Parcours infixe de larbre

You might also like