Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function TNode.CheckNodesOrder(var min, max: integer): Boolean;
- var bufmin,bufmax: integer;
- begin
- min := FInf;
- max := FInf;
- result:=True;
- if (FLeft<>nil)
- then
- begin
- Result:= FLeft.CheckNodesOrder(bufmin,bufmax) and (bufmax<FInf);
- if Result
- then min:=bufmin;
- end;
- if Result and (FRight<>nil)
- then
- begin
- Result:= FRight.CheckNodesOrder(bufmin,bufmax)and (bufmin>=FInf);
- if Result
- then max:=bufmax;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment