本文整理汇总了C#中BinaryTree.CheckCount方法的典型用法代码示例。如果您正苦于以下问题:C# BinaryTree.CheckCount方法的具体用法?C# BinaryTree.CheckCount怎么用?C# BinaryTree.CheckCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BinaryTree
的用法示例。
在下文中一共展示了BinaryTree.CheckCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main()
{
BinaryTree<int> b = new BinaryTree<int>(1,
new BinaryTree<int>(2,
new BinaryTree<int>(3),
new BinaryTree<int>(4)),
new BinaryTree<int>(5,
new BinaryTree<int>(6)));
Console.WriteLine(b.CheckCount());
/*
Tree<int> tree = GenerateTree();
tree.Print();
Console.WriteLine("Root Node: " + tree.Value);
Console.WriteLine("Leaves: ");
SortedSet<int> leaves = new SortedSet<int>();
tree.GetLeaves(ref leaves);
foreach(int i in leaves)
{
Console.WriteLine(i);
}
Console.WriteLine("\n----------\n\n Middle Nodes: ");
SortedSet<int> middleNodes = new SortedSet<int>();
tree.GetMiddleNodes(ref middleNodes);
foreach (int i in middleNodes)
{
Console.WriteLine(i);
}
Console.WriteLine("\n----------\n\n Longest Path: ");
List<int> longestPath = new List<int>();
tree.GetLongestPath(ref longestPath);
foreach (int i in longestPath)
{
Console.WriteLine(i);
}
Console.WriteLine("\n----------\n\n Sum P paths: ");
List<List<int>> paths = new List<List<int>>();
tree.FindPathsWithSumP(16, ref paths);
foreach (List<int> list in paths)
{
foreach(int i in list)
{
Console.Write(i + " ");
}
Console.WriteLine();
}
Console.WriteLine("\n----------\n\n Sum P Subtrees: ");
List<Tree<int>> trees = new List<Tree<int>>();
tree.FindTreesWithSumP(24, ref trees);
foreach (Tree<int> t in trees)
{
t.Print();
}
*/
}