Example #1
0
        static void Main(string[] args)
        {
            Solution s   = new Solution();
            var      res = s.InOrderSuccessor(TestSolution.DesignBT4(), 7);

            System.Console.WriteLine(res?.val);
        }
Example #2
0
        static void Main(string[] args)
        {
            Solution s   = new Solution();
            var      res = s.BTtoArray(TestSolution.DesignBT1());

            for (int i = 0; i < res.Length; i++)
            {
                if (res[i] == 0)
                {
                    System.Console.Write("null" + " ");
                }
                else
                {
                    System.Console.Write(res[i] + " ");
                }
            }
        }