Call traverse(root, array, 0);
int traverse(Node root, int[] a, int index)
{
if(node == NULL)
return index;
int x = traverse(root->left, a, index);
a[x] = root->data;
x = traverse(root->right, a, x+1);
}
Cold Blooded Economist, Hypocrite, Lazy, Pessimistic, Capitalist, Aspiring to be a Devotee of Krishna; Servant of Desire, Anger, Greed, Delusion, Pride and Jealousy
No comments:
Post a Comment