Forum: Object-Pascal / Delphi-Language
Delphi
by sk.Silvia,
22. Apr 2006
i mean, lets have 1,2,3,4,5,6,7,8 as input to this code, its genarets the tree and when we read the tree by 3 types, we get this result
PreOrder :
4;2;1;3;6;5;7;8;
Inorder :
1;2;3;4;5;6;7;8; <-what was our input
Postorder :
1;3;2;5;8;7;6;4;
Forum: Object-Pascal / Delphi-Language
Delphi
by sk.Silvia,
22. Apr 2006
sorry, my fault, i thought you cannot create an tree only from preorder or postorder input and need them both :cat:
how would an alghoritm for preorder input look like (and for postorder its then easy)
we also learned alphabetical trees ,+-*/ tree and heap
thanks
Forum: Object-Pascal / Delphi-Language
Delphi
by sk.Silvia,
22. Apr 2006
wooow, thats great, youare so claver, thanks a million, i had to modify the code a little bit but without you i wouldnt have a chance
procedure TBinTree.CreateInorder(aList :TField; aLeft, aRight : Integer; Var aRoot : TBinTree);
var m:integer;
begin
if aLeft>=aRight then aRoot:=TBinTree.Create(aList,nil,nil)
else
...
Forum: Object-Pascal / Delphi-Language
Delphi
by sk.Silvia,
21. Apr 2006
so nobody? can be any combination of 2 grade of pre-post-in order input
can be also code in C, VB or any language
Forum: Object-Pascal / Delphi-Language
Delphi
by sk.Silvia,
20. Apr 2006
hi there
does somebody know an algorithm for creating a binary tree from an preorder input? Thank you, i searched the web, but with no result:( i know the algortithm for outputing a binnar tree to an preorder output, but that isnt a much big help.
Thanks