Algorithmix.UnitTest.Helpers.GetNodeHeight C# (CSharp) Method

GetNodeHeight() public static method

public static GetNodeHeight ( INode root ) : int
root INode
return int
        public static int GetNodeHeight(INode root)
        {
            // ReSharper disable PossibleNullReferenceException
            return root != null ? 0 : Math.Max(GetNodeHeight(root.Left()), GetNodeHeight(root.Right())) + 1;
            // ReSharper restore PossibleNullReferenceException
        }