本文整理汇总了C++中BinaryTree::inOrderGraph方法的典型用法代码示例。如果您正苦于以下问题:C++ BinaryTree::inOrderGraph方法的具体用法?C++ BinaryTree::inOrderGraph怎么用?C++ BinaryTree::inOrderGraph使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BinaryTree
的用法示例。
在下文中一共展示了BinaryTree::inOrderGraph方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestRootInsertion
void TestRootInsertion()
{
BinaryTree<int> tree;
cout << "Testing root insertion with rotation:" << endl;
srand(time(0));
for (int i = 0; i < 20; ++i)
{
int data = rand() % 100;
cout << "Inserting: " << data << endl;
tree.Insert(data);
tree.inOrderGraph();
}
}
示例2: TestCopyCtor
void TestCopyCtor()
{
BinaryTree<int> tree;
cout << "Testing ints, inserting:" << endl;
srand(time(0));
for (int i = 0; i < 20; ++i)
{
int data = rand() % 100;
cout << data << ", ";
tree.Insert(data);
}
cout << "Original tree:" << endl;
tree.inOrderGraph();
BinaryTree<int> copy(tree);
cout << "Copied tree:" << endl;
copy.inOrderGraph();
}
示例3: outputTree
void outputTree(BinaryTree<T>& tree)
{
cout << endl;
cout << "Tree size: " << tree.count()
<< ", height: " << tree.height() << endl;
cout << "In order traversal:" << endl;
tree.inOrderPrint();
cout << endl;
tree.inOrderGraph();
cout << endl << "Pre order traversal:" << endl;
tree.preOrderPrint();
cout << endl;
tree.preOrderGraph();
cout << endl << "Post order traversal:" << endl;
tree.postOrderPrint();
cout << endl;
tree.postOrderGraph();
cout << endl;
}