From a9b740583184a6c8a0192ba48e62b6c1bb1a6788 Mon Sep 17 00:00:00 2001 From: EmmanuelTiamzon Date: Tue, 3 Feb 2026 12:29:02 +0100 Subject: [PATCH] tp sur les ABR --- DEV.3.2/TP/TP8-ABR/1.Tri/Tri.class | Bin 0 -> 1752 bytes DEV.3.2/TP/TP8-ABR/1.Tri/Tri.java | 62 ++++++++++++++++++ .../2.Authentification/Authentification.java | 10 +++ 3 files changed, 72 insertions(+) create mode 100644 DEV.3.2/TP/TP8-ABR/1.Tri/Tri.class create mode 100644 DEV.3.2/TP/TP8-ABR/1.Tri/Tri.java create mode 100644 DEV.3.2/TP/TP8-ABR/2.Authentification/Authentification.java 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 0000000000000000000000000000000000000000..f00a68fac8af70edf78fe222760e13a9e6de5891 GIT binary patch literal 1752 zcmX^0Z`VEs1_pD62rdQz26avbRt60ap$Q_i*cr6B7+4w9L4*!SM3;j>55&L&mL=-vB<7{-Lqx6F8EhFDSaK6H^B5V#G@>yTXoj&f*fBD21?QI*C8xS& zf^6joDazCX8O6gO!63=QAjlxZ!ywEc!owiSAjZhR98#3Y!ywBb!^0pB;xq6t$TKJ~ zG6*>3=a&?h6eSk;rj}&nrxf$EG1zl3IPfqyGB|NCID=>xb_Q1-1~&$Gb_Nd~22Tbr zb_Q=A1|J4rMg{?pjS$ECCuOB3m!Jqi{KLo~jKvRJ41Ns$j0{YSjEoH8xry1S&iQ%C zi6!BgB^l27dBr7(c_qb+3>F%gzQ+{75{8Tn%#4f*j11~n3~<4!9?2^%`K92P4NIv%HopLTt)`w{L&Ie22qGhGxPNWiZb&`f=h~06LYN@8HB-shAPa+ zz+M1Sl#|EEfMO9OSgk=(9sr7r5JmOu&rXFV97qVdB_@~T7ge$|gfTL( z`Q+zkmliNG@Ob9sr4~8oBo-H^7Be!;K=umM3`qQYB<7{$q!z0{G+IM^0JaJenaCn2 z8bc}zQjsO0%8_Fp<`pDEp+-0-=HvutmZVynfdwR@zKwx>IfJa$76uL!Ne++*ND|}-Ca@2T7M7(^J@8AKU) z7{nL^8N?Zc7^E1a8KfDM7-Sf98RQr&7!(-n859}37?c@;7*rYL7#JAX8CZp+xCGf5 z7(pcm)Wwwy%nVEn3=CF6oIW6T9AgmF2GQFXxOOpcGcfpoc+9&%R)XX?pz<6D`3>M` z00pfa13Lo)g9ZaLgBAl9gEoT%gD!(IgFb^6g8_pDgE808I%~5 zq0XpbU}j(g75vap@zL_t*=NUW#v;lhyNE$TN0i0Lid9>Zbq53QHU{<<7RKfOUustlG4+6*=fMhv!KyTuup{xb+Lu(C6#u!BiPMh1o- p3{nit460yHs4)bC(*`3$AVVla5Q8Lx0XVvu7z`O08H~WB2>_pvdhY-L literal 0 HcmV?d00001 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