Professional Documents
Culture Documents
h>
using namespace std;
// Tree Node
struct Node
{
int data;
Node* left;
Node* right;
Node* nextRight;
};
return temp;
}
istringstream iss(str);
for(string str; iss >> str; )
ip.push_back(str);
return root;
}
Node* next_root=NULL;
root = root->nextRight;
}
printSpecial(next_root);
}
connect(root);
printSpecial(root);
cout<<endl;
inorder(root);
cout<<endl;
}
return 0;
}
// } Driver Code Ends
/* struct Node
{
int data;
Node *left, *right;
Node *nextRight; // This has garbage value in input trees
}; */