Trovare e restituire un nodo con campo info == y

nodo * trova(nodo *x,char y){
 if(!x) return x;  //se l'albero è vuoto ritorno zero
 if(x->info==y) return x;  //abbiamo trovato un nodo
   nodo *z=trova(x->left,y);  //cerco a sinistra
 if(z) return z;  //se non abbiamo trovato niente a sinistra guardo a  destra
   return trova(x->right,y);  //cerco a sinistra
}
Tothebit

About Tothebit

How to whitelist website on AdBlocker?

How to whitelist website on AdBlocker?

  1. 1 Click on the AdBlock Plus icon on the top right corner of your browser
  2. 2 Click on "Enabled on this site" from the AdBlock Plus option
  3. 3 Refresh the page and start browsing the site