Advertisement
Guest User

Untitled

a guest
May 3rd, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1.     public static String decoder(String monTexte, int indice, ArbreHuf monArbreHuf){
  2.         boolean trouve;
  3.         ArbreHuf monArbre = monArbreHuf;
  4.         trouve = monArbreHuf.getLettre() != '\u0000'; // ou null c'est pareil  
  5.  
  6.         while ((!trouve) && (indice <= monTexte.length())){
  7.             if (monTexte.charAt(indice) == '0'){
  8.                 indice += 1;
  9.                 monArbre = monArbre.filsDroit();
  10.                 trouve = monArbre.getLettre() != '\u0000';
  11.             }
  12.             else { //c-a-d quand monTexte.charAt(indice) == '1'
  13.                 indice += 1;
  14.                 monArbre = monArbre.filsDroit();
  15.                 trouve = monArbre.getLettre() != '\u0000';
  16.  
  17.             }
  18.  
  19.         }
  20.         // Quand on a trouvé
  21.         return monArbre.getLettre();
  22.        
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement