示例#1
0
 public int GetSize()
 {
     if (node == null)
     {
         return(0);
     }
     return(node.GetSize());
 }
示例#2
0
        public int GetSize()
        {
            int sum = 1;

            if (left != null)
            {
                sum += left.GetSize();
            }
            if (right != null)
            {
                sum += right.GetSize();
            }
            return(sum);
        }