Da un array C che contiene un cammino, restituire il nodo corrispondente

nodo *trova(nodo *x, int *C,int lung){
 if(!x) return 0;  //se l'albero è vuoto ritorno zero
 if(!lung) return x;
 if(*C==0)
   return trova(x->left,C+1,lung-1);  //restituisce il puntatore al nodo (della parte sinistra) in cui c'è x
 else
   return trova(x->right,C+1,lung-1);  //restituisce il puntatore al nodo (della parte destra) in cui c'è x
}
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