Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void recur(Node root, string prefix){
- if (!root){
- return;
- }
- if (root->value == '\0'){
- print(prefix);
- }
- recur(root->firstChild, prefix + root->value);
- recur(root->rightSibling, prefix);
- }
- void display(Node root){
- if (!root){
- print("");
- }else{
- string prefix = "";
- recur(root, prefix);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement