All pastes #59430 Raw Edit

Anonymous

public text v1 · immutable
#59430 ·published 2006-05-28 21:53 UTC
rendered paste body
int tester(arbre a) {
  int res;
  int def;
  if(a==NULL) {
    res = 1;
  }
  else {
    if((a->droit==NULL) && (a->gauche==NULL)) {
      res = 1;
    }
    else {
      if(((a->gauche != NULL) && (a->val > a->gauche->val)) || ((a->droit != NULL) && (a->val > a->droit->val))) {
        def = 1;
        printf("Noeud deffectueux\n");
        return 0;
      }
      else {
        
          if(a->gauche!=NULL) {
            tester(a->gauche);
          }
          if(a->droit!=NULL) {
            tester(a->droit);
          }
        
      }
    }
  }
  if(def==1) {
    return 0;
  }
  else {
    return 1;
  }
}