gary
public cpp v1 · immutablevoid 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); }}