{
------------------------------------------------------------------------------- 
Autor: Jan Kohlhof
Email: kohj@hrz.tu-chemnitz.de
-------------------------------------------------------------------------------
}

program test;
uses suchbaum,crt;

var b1,b2:baum;
    pre,post:liste;
    i,j:integer;
begin
randomize;
clrscr;
initbaum(b1);
 for i:=1 to 12 do
  begin
   j:=random(20);
   ins(b1,j);
  end;
ausgeben(b1,40,1,20);
writeln('alt');
readln;
clrscr;
pre:=preorder(b1);
post:=postorder(b1);
b2:=rebuild(pre,post);
ausgeben(b2,40,1,20);
writeln('neu');
readln;
clrscr;
end.