本文整理汇总了C#中RedBlackTree.AssertValidTree方法的典型用法代码示例。如果您正苦于以下问题:C# RedBlackTree.AssertValidTree方法的具体用法?C# RedBlackTree.AssertValidTree怎么用?C# RedBlackTree.AssertValidTree使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RedBlackTree
的用法示例。
在下文中一共展示了RedBlackTree.AssertValidTree方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssertValidTree_Invalid_DoubleRed_Right
public void AssertValidTree_Invalid_DoubleRed_Right()
{
RedBlackNode<int> root = new RedBlackNode<int>(100, Colour.Black);
root.Left = new RedBlackNode<int>(50, Colour.Red);
root.Right = new RedBlackNode<int>(150, Colour.Red);
root.Right.Right = new RedBlackNode<int>(160, Colour.Red);
RedBlackTree<int> bst = new RedBlackTree<int>();
bst.Root = root;
bst.AssertValidTree();
}
示例2: AssertValidTree_InvalidChildren
public void AssertValidTree_InvalidChildren()
{
var root = new RedBlackNode<int>(100);
root.Left = new RedBlackNode<int>(150);
RedBlackTree<int> bst = new RedBlackTree<int>();
bst.Root = root;
bst.AssertValidTree();
}
示例3: AssertValidTree_Invalid_BlackMismatch_Left
public void AssertValidTree_Invalid_BlackMismatch_Left()
{
RedBlackNode<int> root = new RedBlackNode<int>(100, Colour.Black);
root.Left = new RedBlackNode<int>(50, Colour.Red);
root.Right = new RedBlackNode<int>(150, Colour.Red);
root.Left.Left = new RedBlackNode<int>(40, Colour.Red);
RedBlackTree<int> bst = new RedBlackTree<int>();
bst.Root = root;
bst.AssertValidTree();
}