示例#1
0
        public void Test(string inputStr, string expected)
        {
            var output    = RecoverFromPreorder(inputStr);
            var outputStr = BinaryTreeConvert.Serialize(output);

            outputStr.Should().Be(expected);
        }
示例#2
0
        public void Test(string inputStr, int key, string expected)
        {
            var root      = BinaryTreeConvert.Deserialize(inputStr);
            var s         = new Solution();
            var output    = s.DeleteNode(root, key);
            var outputStr = BinaryTreeConvert.Serialize(output);

            outputStr.Should().Be(expected);
        }