-
Please Help Me!!!!!!!!
How do I write the tree traverse inorder to look like the actually tree when I output it.
This is what I got so far:
void InOrderTraversal(struct Node *parent)
{
if(parent->Left!= NULL)
InOrderTraversal(parent->Left);
cout << endl;
cout <<( parent->Data);
if(parent->Right!=NULL)
InOrderTraversal(parent->Right);
}
-
Code:
function( Tree *t) {
if(!t)return;
if(t->left)function(t->left);
if(t->right)function(t->right);
display( t->data );
}
Yep. Basicly the same as yours, except I moved where I display the data.
Quzah.