function out = treeSize(t)
% outputs the number of nodes in the BST t
if isempty(t) 
    out = 0; 
else out = 1 + treeSize(t.left)+treeSize(t.right);
end;