davegimo

verifica

Sep 4th, 2019
169
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static boolean verifica(Albero a, Albero b) {
  2.    
  3.     if (!verificaAusiliare(a.val(), b)) {
  4.         return false;
  5.     }
  6.    
  7.     boolean sx = true;
  8.     boolean dx = true;
  9.  
  10.     if (a.sinistro() != null) {
  11.         sx = verifica(a.sinistro(), b);
  12.     }
  13.  
  14.     if (a.destro() != null) {
  15.         dx = verifica(a.destro(), b);
  16.     }
  17.  
  18.     return (sx && dx);
  19.    
  20. }
RAW Paste Data