Mercurial > hg > Applications > Grep
view c/regexParser/printTree.cc @ 87:aef2546cd130
fix
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 19 Oct 2015 20:10:42 +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("-----------------"); }