Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. void stampaNodiLivello(albero T1, albero T2){
  2. FILE* fp = fopen("nodi_comune.txt", "w");
  3. if(fp){
  4. h = altezza(T);
  5. for(int i = 0; i < h; i++)
  6. stampa_aux(T1, T2, i, fp);
  7. }
  8. }
  9.  
  10. void stampa_aux(albero T1, albero T2, int i, FILE* fp){
  11. if(T1 && T2){
  12. if(esiste_nodo_a_livello(T2, T1->info, i))
  13. fprintf(*fp, "%d ", T1->info);
  14. else {
  15. stampa_aux(T1->sx, T2, i, fp);
  16. stampa_aux(T1->dx, T2, i, fp);
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement