本文整理汇总了C++中PrintNode函数的典型用法代码示例。如果您正苦于以下问题:C++ PrintNode函数的具体用法?C++ PrintNode怎么用?C++ PrintNode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PrintNode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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));
}
}
}
开发者ID:CheretaevIvan,项目名称:VisualStudioProjects,代码行数:26,代码来源:search_tree.cpp
示例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);
}
开发者ID:106ohm,项目名称:eigengraph,代码行数:7,代码来源:print-ast.c
示例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.");
}
开发者ID:EmirKalaci,项目名称:BinarySearchTreeTest,代码行数:25,代码来源:main.c
示例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);
}
开发者ID:106ohm,项目名称:eigengraph,代码行数:8,代码来源:print-ast.c
示例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);
}
开发者ID:106ohm,项目名称:eigengraph,代码行数:8,代码来源:print-ast.c
示例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);
}
开发者ID:106ohm,项目名称:eigengraph,代码行数:8,代码来源:print-ast.c
示例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, "]");
}
开发者ID:gap-packages,项目名称:nq,代码行数:14,代码来源:presentation.c
示例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);
}
开发者ID:kannanvijayan,项目名称:whisper,代码行数:10,代码来源:syntax_tree_inlines.hpp
示例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);
}
开发者ID:kannanvijayan,项目名称:whisper,代码行数:10,代码来源:syntax_tree_inlines.hpp
示例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("]");
}
开发者ID:kannanvijayan,项目名称:whisper,代码行数:10,代码来源:syntax_tree_inlines.hpp
示例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);
}
开发者ID:kannanvijayan,项目名称:whisper,代码行数:11,代码来源:syntax_tree_inlines.hpp
示例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";
}
}
开发者ID:3vikasvicky,项目名称:TOB-RSMT,代码行数:12,代码来源:auxiliary.cpp
示例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);
}
开发者ID:106ohm,项目名称:eigengraph,代码行数:12,代码来源:print-ast.c
示例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);
}
开发者ID:kannanvijayan,项目名称:whisper,代码行数:12,代码来源:syntax_tree_inlines.hpp
示例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);
}
开发者ID:106ohm,项目名称:eigengraph,代码行数:12,代码来源:print-ast.c
示例16: PrintNode
void PrintNode(Node rootnode , int dir , int data){
if (rootnode == NULL){
return;
}
if (dir == 0){
printf("%d is the root\n" , data);
}else{
printf("%d is %d's %s child \n" , rootnode -> data , data , dir == 1?"right" : "left");
}
PrintNode(rootnode -> left , -1 , rootnode -> data);
PrintNode(rootnode -> right , 1 , rootnode -> data);
}
开发者ID:helloqiu,项目名称:dataClass,代码行数:12,代码来源:AVL_TREE.c
示例17: PrintAdcl
PRIVATE inline void PrintAdcl(GBUF *out, Node *node, adclNode *u, int offset, UNUSED(Bool norecurse))
{
gbprintf(out, "Adcl: (%d)", node->print_uid);
PrintTQ(out, u->tq, offset, norecurse);
PrintCRSpaces(out, offset + 2);
PrintNode(out, u->type, offset + 2);
PrintCRSpaces(out, offset + 2);
PrintNode(out, u->dimp->dim, offset + 2);
if (u->dimp->size > 0) {
PrintCRSpaces(out, offset + 2);
gbprintf(out, "%d", u->dimp->size);
}
}
开发者ID:106ohm,项目名称:eigengraph,代码行数:13,代码来源:print-ast.c
示例18: memcpy
void SStopWatch::Root::PrintNode(const sptr<ITextOutput>& out, const Node* node, int32_t level) const
{
if (node->prev) PrintNode(out, node->prev, level);
nsecs_t time = node->time;
int64_t counters[NUM_COUNTERS+1];
memcpy(counters, node->counters, sizeof(counters));
if ((flags&B_STOP_WATCH_RAW) == 0) {
// The number of times we performed measurements is twice
// the number of nodes at this leaf in the tree, minus one
// because the top-most node only included one such call
// in its measurement.
const int32_t N = (node->Count()*2) - 1;
time -= timeOverhead*N;
for (int i=0; i<NUM_COUNTERS+1; i++) {
counters[i] -= counterOverhead[i]*N;
}
}
out << MakeIndent(level) << node->name << ": ";
if ((flags&B_STOP_WATCH_NO_TIME) == 0) {
out << (time/1000) << "us";
}
if (extensions&(EXTENSION_PERFORMANCE|EXTENSION_PERFORMANCE_HIGH)) {
if ((flags&B_STOP_WATCH_NO_TIME) == 0) {
out << ", ";
}
out << counters[0] << " " << PerformanceCounterName(B_COUNT_REGISTER_A)
<< ", " << counters[1] << " " << PerformanceCounterName(B_COUNT_REGISTER_B)
<< ", " << counters[2] << " " << PerformanceCounterName(B_COUNT_REGISTER_CYCLES);
for (int i=0; i<perfNumRatios; i++) {
int64_t n = perfRatioNums[i] == B_COUNT_REGISTER_CYCLES
? counters[NUM_COUNTERS] : counters[perfRatioNums[i]-1];
int64_t d = perfRatioDenoms[i] == B_COUNT_REGISTER_CYCLES
? counters[NUM_COUNTERS] : counters[perfRatioDenoms[i]-1];
if (d == 0) d = -1;
out << ", " << (double(n)/double(d))
<< " " << PerformanceCounterAbbreviation(perfRatioNums[i])
<< "/" << PerformanceCounterAbbreviation(perfRatioDenoms[i]);
}
}
out << endl;
if (node->children) {
PrintNode(out, node->children, level+1);
}
}
开发者ID:cambridgehackers,项目名称:openbinder-archive,代码行数:50,代码来源:StopWatch.cpp
示例19: PrintComm
/*
** PrintComm() prints a commutator using the following rule for
** left normed commutators :
** [[a,b],c] = [a,b,c]
*/
static void PrintComm(node *l, node *r, int bracket) {
if (bracket) fprintf(OutFp, "[");
/* If the left operand is a commutator, don't print its brackets. */
if (l->type == TCOMM)
PrintComm(l->cont.op.l, l->cont.op.r, 0);
else
PrintNode(l);
fprintf(OutFp, ",");
PrintNode(r);
if (bracket) fprintf(OutFp, "]");
}
开发者ID:gap-packages,项目名称:nq,代码行数:19,代码来源:presentation.c
示例20: PrintArray
PRIVATE inline void PrintArray(GBUF *out, UNUSED(Node *node), arrayNode *u, int offset, UNUSED(Bool norecurse))
{
gbputs("Array: ", out);
if (u->type) {
PrintCRSpaces(out, offset + 2);
PrintNode(out, u->type, offset + 2);
}
PrintCRSpaces(out, offset + 2);
PrintNode(out, u->name, offset + 2);
PrintCRSpaces(out, offset + 2);
gbputs("List: dims", out);
PrintCRSpaces(out, offset + 4);
PrintList(out, u->dims, offset + 4);
}
开发者ID:106ohm,项目名称:eigengraph,代码行数:14,代码来源:print-ast.c
注:本文中的PrintNode函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论