本文整理汇总了C++中PrintNode函数的典型用法代码示例。如果您正苦于以下问题:C++ PrintNode函数的具体用法?C++ PrintNode怎么用?C++ PrintNode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PrintNode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrintNode
void PrintNode(PNode *Tree){
if (*Tree){
printf("Элемент: ");
PrintData(&(*Tree)->data);
if ((*Tree)->left){
printf(" Л: ");
PrintData(&(*Tree)->left->data);
}
else
printf(" Л: *");
if ((*Tree)->right){
printf(" П: ");
PrintData(&(*Tree)->right->data);
}
else
printf(" П: *");
printf("\n");
if ((*Tree)->left){
PrintNode(&(*Tree)->left);
}
if ((*Tree)->right){
PrintNode(&((*Tree)->right));
}
}
}
示例2: PrintProc
PRIVATE inline void PrintProc(GBUF *out, UNUSED(Node *node), procNode *u, UNUSED(int offset), UNUSED(Bool norecurse))
{
gbputs("Proc:\n ", out);
PrintNode(out, u->decl, 2);
gbputs("\n ", out);
PrintNode(out, u->body, 2);
}
示例3: main
int main()
{
root = NULL;
root2 = NULL;
int randomData = 0;
srand(time(NULL));
for (int i = 0; i<30; ++i)
{
randomData = rand()%1000;
BinarySearchTreeCreate(&root,randomData);
BinaryTreeCreate(&root2,randomData);
}
bool isBinarySearchTree = BinarySearchTreeTest(root,0,1000);
bool isBinarySearchTree2 = BinarySearchTreeTest(root2,0,1000);
PrintNode(root);
printf("\n%s\n", isBinarySearchTree ? "The tree is a binary search tree.\n" :
"The tree is not a binary search tree.\n");
PrintNode(root2);
printf("\n%s\n", isBinarySearchTree2 ? "The tree is binary a search tree." :
"The tree is not a binary search tree.");
}
示例4: PrintConstructor
PRIVATE inline void PrintConstructor(GBUF *out, UNUSED(Node *node), constructorNode *u, int offset, UNUSED(Bool norecurse))
{
gbprintf(out, "Constructor: List: exprs");
PrintCRSpaces(out, offset + 2);
PrintNode(out, u->type, offset + 2);
PrintCRSpaces(out, offset + 2);
PrintNode(out, u->initializerlist, offset + 2);
}
示例5: PrintDo
PRIVATE inline void PrintDo(GBUF *out, Node *node, DoNode *u, int offset, UNUSED(Bool norecurse))
{
gbprintf(out, "Do: (%d) ", node->print_uid);
PrintCRSpaces(out, offset + 2);
PrintNode(out, u->stmt, offset + 2);
PrintCRSpaces(out, offset + 2);
PrintNode(out, u->expr, offset + 2);
}
示例6: PrintIf
PRIVATE inline void PrintIf(GBUF *out, UNUSED(Node *node), IfNode *u, int offset, UNUSED(Bool norecurse))
{
gbputs("If: ", out);
PrintCRSpaces(out, offset + 2);
PrintNode(out, u->expr, offset + 2);
PrintCRSpaces(out, offset + 2);
PrintNode(out, u->stmt, offset + 2);
}
示例7: PrintEngel
/*
** PrintEngel() prints a commutator using the following rule for
** Engel relations:
** [u, n v]
*/
static void PrintEngel(node *l, node *r, node *e) {
fprintf(OutFp, "[");
PrintNode(l);
fprintf(OutFp, ", ");
PrintNode(e);
fprintf(OutFp, " ");
PrintNode(r);
fprintf(OutFp, "]");
}
示例8: PrintWhileStatement
void
PrintWhileStatement(const CodeSource &src, const WhileStatementNode *node,
Printer pr, int tabDepth)
{
pr("while (");
PrintNode(src, node->condition(), pr, tabDepth+1);
pr(")\n");
PrintTabDepth(tabDepth+1, pr);
PrintNode(src, node->body(), pr, tabDepth+1);
}
示例9: PrintWithStatement
void
PrintWithStatement(const CodeSource &src, const WithStatementNode *node,
Printer pr, int tabDepth)
{
pr("with (");
PrintNode(src, node->value(), pr, tabDepth);
pr(")\n");
PrintTabDepth(tabDepth+1, pr);
PrintNode(src, node->body(), pr, tabDepth+1);
}
示例10: PrintGetElementExpression
void
PrintGetElementExpression(const CodeSource &src,
const GetElementExpressionNode *node,
Printer pr, int tabDepth)
{
PrintNode(src, node->object(), pr, tabDepth);
pr("[");
PrintNode(src, node->element(), pr, tabDepth);
pr("]");
}
示例11: PrintConditionalExpression
void
PrintConditionalExpression(const CodeSource &src,
const ConditionalExpressionNode *node,
Printer pr, int tabDepth)
{
PrintNode(src, node->condition(), pr, tabDepth);
pr(" ? ");
PrintNode(src, node->trueExpression(), pr, tabDepth);
pr(" : ");
PrintNode(src, node->falseExpression(), pr, tabDepth);
}
示例12: PrintEdge
void PrintEdge(SGEdge* E)
{
if(E!=NULL)
{
cout<<"Print SGEdge from -> to (Routed="<<E->checkRouted()<<", Enable="<<E->checkEnable()<<" TurnRect="<<E->checkTurnRect()<<")\n";
PrintNode(E->getFromNode());
PrintNode(E->getToNode());
}
else
{ cout<<"NULL\n";
}
}
示例13: PrintFor
PRIVATE inline void PrintFor(GBUF *out, Node *node, ForNode *u, int offset, UNUSED(Bool norecurse))
{
gbprintf(out, "For: (%d) ", node->print_uid);
PrintCRSpaces(out, offset + 2);
PrintNode(out, u->init, offset + 2);
PrintCRSpaces(out, offset + 2);
PrintNode(out, u->cond, offset + 2);
PrintCRSpaces(out, offset + 2);
PrintNode(out, u->next, offset + 2);
PrintCRSpaces(out, offset + 2);
PrintNode(out, u->stmt, offset + 2);
}
示例14: PrintForInStatement
void
PrintForInStatement(const CodeSource &src, const ForInStatementNode *node,
Printer pr, int tabDepth)
{
pr("for (");
PrintNode(src, node->lhs(), pr, tabDepth);
pr(" in ");
PrintNode(src, node->object(), pr, tabDepth);
pr(")\n");
PrintTabDepth(tabDepth+1, pr);
PrintNode(src, node->body(), pr, tabDepth+1);
}
示例15: PrintReturn
PRIVATE inline void PrintReturn(GBUF *out, UNUSED(Node *node), ReturnNode *u, int offset, Bool UNUSED(norecurse))
{
gbputs("Return: ", out);
#if 0
if (u->expr) {
PrintCRSpaces(out, offset + 2);
PrintNode(out, NodeDataType(u->expr), offset + 2);
}
#endif
PrintCRSpaces(out, offset + 2);
PrintNode(out, u->expr, offset + 2);
}