本文整理汇总了C++中NodeTree::check方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeTree::check方法的具体用法?C++ NodeTree::check怎么用?C++ NodeTree::check使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeTree
的用法示例。
在下文中一共展示了NodeTree::check方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: debug
void debug(int argc, char* argv[])
{
#ifdef RODOLPHE
#endif
#ifdef SAMUEL
NodeTree nTree;
// ARRAYTREE
#if 0
nTree.insertNLeaves(15);
#if 1
ArrayTree aTree(nTree);
aTree.dumpToStdout();
std::cout << aTree.to_str() << std::endl;
assert(aTree.check(aTree.getRoot()));
std::cout << "Check 1 Ok" << std::endl;
#endif
#if 0
int subTree = aTree.degraph(1);
std::cout << "aTree._root=" << aTree.getRoot() << std::endl;
aTree.dumpToStdout();
std::cout << aTree.to_str() << std::endl;
assert(aTree.check(0));
std::cout << "Check 2 Ok" << std::endl;
#endif
#if 0
std::cout << aTree.regraph(1, aTree.getRoot()) << std::endl;
std::cout << "aTree._root=" << aTree.getRoot() << std::endl;
aTree.dumpToStdout();
std::cout << aTree.to_str() << std::endl;
assert(aTree.check(0));
std::cout << "Check 3 Ok" << std::endl;
#endif
#if 1
std::vector<int> nodes = aTree.SPR_list_init(3);
aTree.SPR_list(3, nodes);
std::cout << aTree.to_str() << std::endl;
assert(aTree.check(aTree.getRoot()));
std::cout << "Check 4 Ok" << std::endl;
#endif
// NODETREE
#else
nTree.insertNLeaves(10);
NodeTree copy(nTree);
std::cout << nTree.to_str() << std::endl;
std::cout << nTree.check() << std::endl;
std::cout << copy.to_str() << std::endl;
std::cout << copy.check() << std::endl;
NodeTree* A = &nTree;
NodeTree* B = ©
Node* nodeA = (*A).nodeAt(1);
Node* nodeB = (*B).nodeAt(1);
std::cout << nodeA->to_str() << std::endl;
std::cout << nodeB->to_str() << std::endl;
#if 0
std::vector<Node*> nodesA = (*A).SPR_list_init(nodeA);
(*A).SPR_list(nodeA, nodesA);
std::vector<Node*> nodesB = (*B).SPR_list_init(nodeB);
(*B).SPR_list(nodeB, nodesB);
#else
(*A).SPR_ite(nodeA);
(*B).SPR_rec(nodeB);
#endif
std::cout << (*A).to_str() << std::endl;
std::cout << (*A).getRoot()->to_str() << std::endl;
std::cout << (*A).check() << std::endl;
std::cout << (*B).to_str() << std::endl;
std::cout << (*B).getRoot()->to_str() << std::endl;
std::cout << (*B).check() << std::endl;
#endif
#endif
}