Jovfer

Untitled

Jan 15th, 2013
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.24 KB | None | 0 0
  1. function count(tmp: TTree): integer;
  2. var left,right: integer;
  3. begin
  4.    if tmp.left = nil then left:=0 else left:=count(tmp.left);
  5.    if tmp.right = nil then right :=0 else right:= count(tmp.right);
  6.    result:= 1+max(left,right);
  7. end;
Advertisement
Add Comment
Please, Sign In to add comment