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

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