diff --git a/DEV.3.2/TP/TP8-ABR/1.Tri/Tri.class b/DEV.3.2/TP/TP8-ABR/1.Tri/Tri.class new file mode 100644 index 0000000..f00a68f Binary files /dev/null and b/DEV.3.2/TP/TP8-ABR/1.Tri/Tri.class differ diff --git a/DEV.3.2/TP/TP8-ABR/1.Tri/Tri.java b/DEV.3.2/TP/TP8-ABR/1.Tri/Tri.java new file mode 100644 index 0000000..d22cda5 --- /dev/null +++ b/DEV.3.2/TP/TP8-ABR/1.Tri/Tri.java @@ -0,0 +1,62 @@ +import java.awt.*; + +public class Tri { + + private boolean estVide; + private double valeur; + private Tri filsGauche; + private Tri filsDroit; + + public Tri() { + this.estVide = true; + } + + public Tri(double valeur) { + this.estVide = false; + this.valeur = valeur; + } + + public void ajouter(double valeur) { + if(this.estVide) { + this.valeur = valeur; + this.estVide = false; + return; + } + + if(valeur < this.valeur) { + if(this.filsGauche == null) { + this.filsGauche = new Tri(); + } + filsGauche.ajouter(valeur); + } else { + if(this.filsDroit == null) { + this.filsDroit = new Tri(); + } + filsDroit.ajouter(valeur); + } + } + + public String toString() { + String aRenvoyer = ""; + + if(this.filsGauche != null) { + aRenvoyer += this.filsGauche.toString(); + } + aRenvoyer += this.valeur + " "; + + if(this.filsDroit != null) { + aRenvoyer += this.filsDroit.toString(); + } + + return aRenvoyer; + } + + public static void main(String[] args) { + Tri racine = new Tri(); + + for(String chaine : args) { + racine.ajouter(Double.parseDouble(chaine)); + } + System.out.println(racine); + } +} \ No newline at end of file diff --git a/DEV.3.2/TP/TP8-ABR/2.Authentification/Authentification.java b/DEV.3.2/TP/TP8-ABR/2.Authentification/Authentification.java new file mode 100644 index 0000000..2fa942c --- /dev/null +++ b/DEV.3.2/TP/TP8-ABR/2.Authentification/Authentification.java @@ -0,0 +1,10 @@ +public class Authentification { + + private tr identifiant; + private mdp; + + + public Authentification() { + + } +} \ No newline at end of file