Funzione che stampa il campo info ogni k nodi

int f1(nodo *x, int salta, int k){
 if(x){  return salta;
   salta=f1(x->left,salta,k);
   salta=f1(x->right,salta,k);
 if(salta==0){
   cout<<x->info;
   return k-1;
 }else 
  return salta-1;
}
 
//invocazione:
int k=3;
k=f1(root,k-1,k);
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