|
|
DataMuseum.dkPresents historical artifacts from the history of: Rational R1000/400 Tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Rational R1000/400 Tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: B T
Length: 1886 (0x75e)
Types: TextFile
Names: »B«
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
└─⟦129cab021⟧ »DATA«
└─⟦this⟧
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
└─⟦d65440be7⟧ »DATA«
└─⟦this⟧
package body Arbres is
procedure Affectation (X : Arbre; Y : in out Arbre) is
begin
if X = null then
Y := null;
else
Y := new Noeud'(E => X.E, Gauche => null, Droit => null);
Affectation (X.Gauche, Y.Gauche);
Affectation (X.Droit, Y.Droit);
end if;
end Affectation;
procedure Construire (Un_Element : Element; A : in out Arbre) is
begin
A := new Noeud'(E => Un_Element, Gauche => null, Droit => null);
end Construire;
function Est_Vide (A : Arbre) return Boolean is
begin
return (A = null);
end Est_Vide;
function Valeur_Arbre (A : Arbre) return Element is
begin
return A.E;
end Valeur_Arbre;
function Sous_Arbre_Gauche (A : Arbre) return Arbre is
begin
return A.Gauche;
end Sous_Arbre_Gauche;
function Sous_Arbre_Droit (A : Arbre) return Arbre is
begin
return A.Droit;
end Sous_Arbre_Droit;
function Recherche (Un_Element : Element; A : Arbre) return Arbre is
begin
[statement]
end Recherche;
procedure Parcours_Gdr (A : Arbre) is
begin
[statement]
end Parcours_Gdr;
procedure Inserer (Un_Element : Element; Un_Arbre : in out Arbre) is
Arbre_Temporaire : Arbre := null;
begin
Arbre_Temporaire := A;
if Est_Vide (Arbre_Temporaire) then
Construire (E, Arbre_Temporaire);
else
if Egal (E, Arbre_Temporaire.E) = False then
if Superieur (E, Arbre_Temporaire.E) then
Inserer (E, Arbre_Temporaire.Droit);
else
Inserer (E, Arbre_Temporaire.Gauche);
end if;
else
Text_Io.Put_Line ("Cet element existe deja");
end if;
end if;
end Inserer;
end Arbres;