-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deployed 123cbce with MkDocs version: 1.5.3
- Loading branch information
Unknown
committed
Jan 21, 2024
1 parent
49c9044
commit bf9aa1f
Showing
2,429 changed files
with
120,512 additions
and
969 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
class Noeud : | ||
"""objet Noeud d'un arbre binaire""" | ||
def __init__(self, val = None, filsG = None, filsD = None) : | ||
self.set_val(val) | ||
self.set_filsG(filsG) | ||
self.set_filsD(filsD) | ||
|
||
def get_val(self): | ||
return self.val | ||
|
||
def set_val(self, nouvelle_val): | ||
self.val = nouvelle_val | ||
|
||
def get_filsG(self): | ||
return self.filsG | ||
|
||
def set_filsG(self, nouveau_filsG): | ||
self.filsG = nouveau_filsG | ||
|
||
def get_filsD(self): | ||
return self.filsD | ||
|
||
def set_filsD(self, nouveau_filsD): | ||
self.filsD = nouveau_filsD | ||
|
||
def __str__(self): | ||
return f"{self.get_val()}, {self.get_filsG()}, {self.get_filsD()}" | ||
|
||
def hauteur(arbre): | ||
return ... | ||
|
||
|
||
# Création de l'arbre | ||
arbre = Noeud(1,Noeud(2, Noeud(4),Noeud(5)), Noeud(3, filsD = Noeud(6))) | ||
|
||
print(hauteur(arbre)) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
class Noeud : | ||
"""objet Noeud d'un arbre binaire""" | ||
def __init__(self, val = None, filsG = None, filsD = None) : | ||
self.set_val(val) | ||
self.set_filsG(filsG) | ||
self.set_filsD(filsD) | ||
|
||
def get_val(self): | ||
return self.val | ||
|
||
def set_val(self, nouvelle_val): | ||
self.val = nouvelle_val | ||
|
||
def get_filsG(self): | ||
return self.filsG | ||
|
||
def set_filsG(self, nouveau_filsG): | ||
self.filsG = nouveau_filsG | ||
|
||
def get_filsD(self): | ||
return self.filsD | ||
|
||
def set_filsD(self, nouveau_filsD): | ||
self.filsD = nouveau_filsD | ||
|
||
def __str__(self): | ||
return f"{self.get_val()}, {self.get_filsG()}, {self.get_filsD()}" | ||
|
||
def hauteur(arbre): | ||
if arbre == None: | ||
return 0 | ||
else : | ||
return 1 + max(hauteur(arbre.get_filsG()), hauteur(arbre.get_filsD())) | ||
|
||
|
||
# Création de l'arbre | ||
arbre = Noeud(1,Noeud(2, Noeud(4),Noeud(5)), Noeud(3, filsD = Noeud(6))) | ||
|
||
print(taille(arbre)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
assert hauteur(Noeud(1,Noeud(2, Noeud(4),Noeud(5)), Noeud(3, filsD = Noeud(6)))) == 3, "L'arbre n'a pas la bonne hauteur" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
class Noeud : | ||
"""objet Noeud d'un arbre binaire""" | ||
def __init__(self, val = None, filsG = None, filsD = None) : | ||
self.set_val(val) | ||
self.set_filsG(filsG) | ||
self.set_filsD(filsD) | ||
|
||
def get_val(self): | ||
return self.val | ||
|
||
def set_val(self, nouvelle_val): | ||
self.val = nouvelle_val | ||
|
||
def get_filsG(self): | ||
return self.filsG | ||
|
||
def set_filsG(self, nouveau_filsG): | ||
self.filsG = nouveau_filsG | ||
|
||
def get_filsD(self): | ||
return self.filsD | ||
|
||
def set_filsD(self, nouveau_filsD): | ||
self.filsD = nouveau_filsD | ||
|
||
def __str__(self): | ||
return f"{self.get_val()}, {self.get_filsG()}, {self.get_filsD()}" | ||
|
||
|
||
# Création de l'arbre | ||
arbre = ... | ||
|
||
print(arbre) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
class Noeud : | ||
"""objet Noeud d'un arbre binaire""" | ||
def __init__(self, val = None, filsG = None, filsD = None) : | ||
self.set_val(val) | ||
self.set_filsG(filsG) | ||
self.set_filsD(filsD) | ||
|
||
def get_val(self): | ||
return self.val | ||
|
||
def set_val(self, nouvelle_val): | ||
self.val = nouvelle_val | ||
|
||
def get_filsG(self): | ||
return self.filsG | ||
|
||
def set_filsG(self, nouveau_filsG): | ||
self.filsG = nouveau_filsG | ||
|
||
def get_filsD(self): | ||
return self.filsD | ||
|
||
def set_filsD(self, nouveau_filsD): | ||
self.filsD = nouveau_filsD | ||
|
||
def __str__(self): | ||
return f"{self.get_val()}, {self.get_filsG()}, {self.get_filsD()}" | ||
|
||
|
||
# Création de l'arbre | ||
arbre = Noeud(1,Noeud(2, Noeud(4),Noeud(5)), Noeud(3, filsD = Noeud(6))) | ||
|
||
print(arbre) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
assert arbre.__str__() == '1, 2, 4, None, None, 5, None, None, 3, None, 6, None, None', "L'arbre n'a pas poussé correctement..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
class Noeud : | ||
"""objet Noeud d'un arbre binaire""" | ||
def __init__(self, val = None, filsG = None, filsD = None) : | ||
self.set_val(val) | ||
self.set_filsG(filsG) | ||
self.set_filsD(filsD) | ||
|
||
def get_val(self): | ||
return self.val | ||
|
||
def set_val(self, nouvelle_val): | ||
self.val = nouvelle_val | ||
|
||
def get_filsG(self): | ||
return self.filsG | ||
|
||
def set_filsG(self, nouveau_filsG): | ||
self.filsG = nouveau_filsG | ||
|
||
def get_filsD(self): | ||
return self.filsD | ||
|
||
def set_filsD(self, nouveau_filsD): | ||
self.filsD = nouveau_filsD | ||
|
||
def __str__(self): | ||
return f"{self.get_val()}, {self.get_filsG()}, {self.get_filsD()}" | ||
|
||
def taille(arbre): | ||
return ... | ||
|
||
|
||
# Création de l'arbre | ||
arbre = Noeud(1,Noeud(2, Noeud(4),Noeud(5)), Noeud(3, filsD = Noeud(6))) | ||
|
||
print(taille(arbre)) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
class Noeud : | ||
"""objet Noeud d'un arbre binaire""" | ||
def __init__(self, val = None, filsG = None, filsD = None) : | ||
self.set_val(val) | ||
self.set_filsG(filsG) | ||
self.set_filsD(filsD) | ||
|
||
def get_val(self): | ||
return self.val | ||
|
||
def set_val(self, nouvelle_val): | ||
self.val = nouvelle_val | ||
|
||
def get_filsG(self): | ||
return self.filsG | ||
|
||
def set_filsG(self, nouveau_filsG): | ||
self.filsG = nouveau_filsG | ||
|
||
def get_filsD(self): | ||
return self.filsD | ||
|
||
def set_filsD(self, nouveau_filsD): | ||
self.filsD = nouveau_filsD | ||
|
||
def __str__(self): | ||
return f"{self.get_val()}, {self.get_filsG()}, {self.get_filsD()}" | ||
|
||
def taille(arbre): | ||
if arbre == None: | ||
return 0 | ||
else: | ||
return 1 + taille(arbre.get_filsG()) + taille(arbre.get_filsD()) | ||
|
||
|
||
# Création de l'arbre | ||
arbre = Noeud(1,Noeud(2, Noeud(4),Noeud(5)), Noeud(3, filsD = Noeud(6))) | ||
|
||
print(taille(arbre)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
assert taille(Noeud(1,Noeud(2, Noeud(4),Noeud(5)), Noeud(3, filsD = Noeud(6)))) == 6, "L'arbre n'est pas de la bonne taille" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.