home *** CD-ROM | disk | FTP | other *** search
/ ftp.disi.unige.it / 2015-02-11.ftp.disi.unige.it.tar / ftp.disi.unige.it / pub / .person / CataniaB / teach-act / esempi / Tipi_di_dato / Alberi / maintree.c < prev    next >
C/C++ Source or Header  |  1997-05-11  |  336b  |  19 lines

  1. #include <stdio.h>
  2. #include "trees.h"
  3.  
  4. main()
  5. {
  6.  
  7.  tree T;
  8.  tree T1;
  9.  tree T2,T3;
  10.  T=maketree(4,maketree(2,emptytree(),emptytree()),
  11.    maketree(9,maketree(2,emptytree(),emptytree()),emptytree()));
  12.  T1=maketree(90,emptytree(),emptytree());
  13.  T2=maketree(45,emptytree(),emptytree());
  14.  append(2,T,T1,T2);
  15.  bfs(T);
  16.  copy(T,&T3);
  17.  bfs(T3);
  18. }
  19.