All pastes #461225 Raw Edit

gary

public cpp v1 · immutable
#461225 ·published 2007-04-27 16:03 UTC
rendered paste body
void printTree(Node * t, char * s){    Node * H = t; // Is there a reason why we're making a copy of this object?    if (H->kind == leaf)    {        cout << H->ch << ":\t" << s << endl;    }        if (H->left)    {        char nl[STR_LEN];        snprintf(nl, STR_LEN, "%s0", s);        printTree(H->left, nl);    }        if (H->right)    {        char nr[STR_LEN];        snprintf(nr, STR_LEN, "%s1", s);        printTree(H->right, nr);    }}