Vidyalelo
Data Structure · Q63

Binary Search Trees(B Tree)

Programming · Data Structure · question 63

Q63

What is the code below trying to print? void print(tree *root,tree *node) if(root ==null) return 0 if(root-->left==node || root-->right==node) || print(root->left,node) ||printf(root->right,node) print(root->data)

A.
just printing all nodes
B.
not a valid logic to do any task
C.
printing ancestors of a node passed as argument
Answer
D.
printing nodes from leaf node to a node passed as argument

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board