program alberi; uses newbst,naturali; var t:searchtree; success:boolean; x:nat; procedure createbst(var t:searchtree); {legge dei naturali dallo schermo e crea un albero che li contiene} var n:nat; begin writeln('Scrivi dei naturali e premi enter:'); while not eoln do begin n.legginat(input); t.insert(n,success) end; end; begin t.init; createbst(t); t.display; writeln; writeln('Questo albero ha profondita'' ',t.prof,'.'); writeln; writeln('La somma degli elementi di questo albero e'' ',t.somma,'.'); writeln; writeln('L''elemento piu'' grande in questo albero e'' ',t.max,'.'); t.done end.