本文整理匯總了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();
}
*/
}