All pastes #59656 Raw Edit

Stuff

public text v1 · immutable
#59656 ·published 2006-05-29 20:35 UTC
rendered paste body
int tester(arbre a) {
  int res;
  res = 1;
  if(a==NULL) {
    return 1;
  }
  else {
    if(((a->gauche!=NULL) && (a->val > a->gauche->val)) || ((a->droit!=NULL) && (a->val > a->droit->val))) {
      return 0;
    }
    else {
         if((a->gauche==NULL) && (a->droit==NULL)) {
           return 1;
         }
         else if((a->gauche!=NULL) && (a->droit!=NULL)) {
           res = res * tester(a->gauche) * tester(a->droit);
         }
         else if(a->gauche!=NULL) {
           res = res * tester(a->gauche);
         }
         else {
           res = res * tester(a->droit);
         }
    }
  }
  return res;
}