Mercurial > hg > Applications > Grep
view c/regexParser/printTree.cc @ 85:5072a44ed842
add Word
author | masa |
---|---|
date | Thu, 08 Oct 2015 20:07:32 +0900 |
parents | 52da06c3f050 |
children | 50a146c05192 |
line wrap: on
line source
#include <stdio.h> #include "regexParser.h" void descendTree(NodePtr n) { static int d = 0; if (n->right != NULL) { d++; descendTree(n->right); d--; } printf("%*c%c\n",d*4, ' ',n->Value.character); if (n->left != NULL) { d++; descendTree(n->left); d--; } } void printTree(NodePtr n) { puts("---Print Node----"); descendTree(n); puts("-----------------"); }