1. Dr. Ammar LADJAILIA Université de Souk Ahras
Arbre binaire de recherche
UNIVERSITÉ DE SOUK AHRAS
FACULTÉ DES SCIENCES ET DE LA TECHNOLOGIE
DÉPARTEMENT DE MATHÉMATIQUES ET INFORMATIQUE
2. Dr. Ammar Ladjailia Université de Souk Ahras
Plan
➔ Arbre binaire de recherche
➔ Opération sur ABR
2
3. Dr. Ammar Ladjailia Université de Souk Ahras
Arbre binaire de recherche
Définition
Un arbre binaire de recherche (Anlgais: Binary search
tree) est un arbre binaire vérifiant la propriété suivante:
𝑺𝒐𝒊𝒕 𝒙, 𝒚 ∈ 𝑨𝒓𝒃𝒓𝒆,
𝒔𝒊 𝒚 ∈ 𝑺𝑨𝑮 𝒅𝒆 𝒙 𝒂𝒍𝒐𝒓𝒔 𝐢𝐧𝐟 𝒙 > 𝐢𝐧𝐟 𝒚
&
𝒔𝒊 𝒚 ∈ 𝑺𝑨𝑫 𝒅𝒆 𝒙 𝒂𝒍𝒐𝒓𝒔 𝐢𝐧𝐟(𝒙) < 𝐢𝐧𝐟(𝒚)
4. Dr. Ammar Ladjailia Université de Souk Ahras
Arbre binaire de recherche
Exemple
10
5 15
3 8
10
9 15
3 8
Arbre binaire de recherche N’est pas un arbre binaire de
recherche
5. Dr. Ammar Ladjailia Université de Souk Ahras
Arbre binaire de recherche
Opérations : Recherche
10
5 15
3 8
6. Dr. Ammar Ladjailia Université de Souk Ahras
Arbre binaire de recherche
Opérations : Min & Max
10
5 15
3 8
Min
Max
7. Dr. Ammar Ladjailia Université de Souk Ahras
Arbre binaire de recherche
Opérations : Successeur & Prédécesseur
10
5 15
3 8
8. Dr. Ammar Ladjailia Université de Souk Ahras
Arbre binaire de recherche
Opérations : Insertion
10
5 15
3 8
20
k
p
9. Dr. Ammar Ladjailia Université de Souk Ahras
Opérations : Suppression
Cas 1 : Suppression feuille
Cas 2 : Suppression un nœud avec 1 fils
Cas 3: Suppression d’un nœud avec 2 fils
10
5 15
3 8
4
10. Dr. Ammar Ladjailia Université de Souk Ahras
Arbre binaire de recherche
Opérations : Suppression
10
5 15
3 8
Cas 1 : suppression des feuilles
A1
P
11. Dr. Ammar Ladjailia Université de Souk Ahras
Arbre binaire de recherche
Opérations : Suppression
10
5 15
3 8
Cas 2 : suppression d’un nœud avec un fils
A1
P
4
f
12. Dr. Ammar Ladjailia Université de Souk Ahras
Arbre binaire de recherche
Opérations : Suppression
10
5 15
3 8
Cas 3 : suppression d’un nœud avec 2 fils
pr
A1