You are viewing a single comment's thread. Return to all comments →
Can anyone tell me what is the problem here ?
C solution :
void levelOrder(node * root) { static int i=0; if(i==0){ printf("%d ",root->data); i++; } if(root==NULL) return; if(root->left==NULL && root->right==NULL); return; if(root->left!=NULL) printf("%d ",root->left->data); if(root->right!=NULL) printf("%d ",root->right->data); levelOrder(root->left); levelOrder(root->right); }
Thanks!
Seems like cookies are disabled on this browser, please enable them to open this website
Tree: Level Order Traversal
You are viewing a single comment's thread. Return to all comments →
Can anyone tell me what is the problem here ?
C solution :
Thanks!