Output of the code


#1

Consider the following code
void fun (struct node* ptr)
{ if(!ptr)
Return;
fun(ptr->left);
printf("%d", ptr->data);
fun(ptr->right);
printf(ptr->data);
}
What is the output


#2

The question is incomplete as the function call is not specified.
Consider calling fun and passing the root node ie 10.
O/P: 40,40,20,20,10,30,30,10