Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String decoder(String monTexte, int indice, ArbreHuf monArbreHuf){
- boolean trouve;
- ArbreHuf monArbre = monArbreHuf;
- trouve = monArbreHuf.getLettre() != '\u0000'; // ou null c'est pareil
- while ((!trouve) && (indice <= monTexte.length())){
- if (monTexte.charAt(indice) == '0'){
- indice += 1;
- monArbre = monArbre.filsDroit();
- trouve = monArbre.getLettre() != '\u0000';
- }
- else { //c-a-d quand monTexte.charAt(indice) == '1'
- indice += 1;
- monArbre = monArbre.filsDroit();
- trouve = monArbre.getLettre() != '\u0000';
- }
- }
- // Quand on a trouvé
- return monArbre.getLettre();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement