You are viewing a single comment's thread. Return to all comments →
#include <string> void po(node *n, string &s) { s = to_string(n->data) + " " + s; if (n->right) po(n->right, s); if (n->left) po(n->left, s); } void postOrder(node *root) { string s=""; po(root, s); cout << s; }
Seems like cookies are disabled on this browser, please enable them to open this website
Tree: Postorder Traversal
You are viewing a single comment's thread. Return to all comments →