Funzioni di stampa nei 3 principali modi di scorrimento

Funzione ricorsiva stampa in ordine prefisso

void STAMPA(nodo *root){
 if(root){
   cout<<root->info<<"(";
   STAMPA(root->left);
   cout<<",";
   STAMPA(root->right);
   cout<<")";
 }else
   cout<<"_";
}

Funzione ricorsiva stampa in ordine infisso

void infix(nodo *x){
 if(x){
   infix(x->left);
     cout<<x->info;
   infix(x->right);
 }
 }

Funzione ricorsiva stampa in ordine postfisso

void postfix(nodo *x){
 if(x){
   postfix(x->left);
   postfix(x->right);
   cout<<x->info;
 }
 }
Tothebit

About Tothebit

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