diff --git a/Tree.cpp b/Tree.cpp index d94007b..9c59ae2 100644 --- a/Tree.cpp +++ b/Tree.cpp @@ -38,7 +38,13 @@ void Traverse (NODE *root) { cout<data<<" "; if (cur->right != NULL) Traverse (cur->right); } - +void preorder(NODE*root){ + //NODE*cur=root; + if(root==NULL) return; + cout<data<<" "; + preorder(root->left); + preorder(root->right); +} // main int main () { NODE *root = NULL; @@ -59,5 +65,7 @@ int main () { */ cout<<"Tree in INORDER traversal: "<