Esempio n. 1
0
        public static int Height(BT.Node node)
        {
            if (node == null)
            {
                return(0);
            }

            return(1 + Math.Max(Height(node.Left), Height(node.Right)));
        }
Esempio n. 2
0
        public static bool IsFull(BT.Node node)
        {
            if (node == null)
            {
                return(false);
            }

            if (node.Left != null && node.Right != null)
            {
                return(IsFull(node.Left) && IsFull(node.Right));
            }
            else if (node.Left == null && node.Right == null)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }