public void Test(string inputStr, string expected) { var output = RecoverFromPreorder(inputStr); var outputStr = BinaryTreeConvert.Serialize(output); outputStr.Should().Be(expected); }
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); }