the compiler compile the code,but traversing output is wrong .please chech ny logic is correct,tell me best tutorial to learn of binary tree using stack .
void usman:: inorder()
{
stack<node*>s;
node *t=root;
while(!s.empty()||t!=NULL)
{
if(t!=NULL)
{
s.push(t);
t=t->left;
}
else
{
t=s.top();
s.pop();
cout<<t->data<<",";
t=t->right;
}
}
}