@prateek111 you can’t construct the binary tree with all the other options other than c.
To solve this question we have to look at two things: 1) In a binary tree, a node may have at most 2 children. 2) To construct binary tree from the given sequences above, innermost parenthesis should be worked first
In Option A :
( 4 5 6 7 ) is there, which says that node 4 has got three children, which is wrong for a binary tree, and also in the question, only ( X Y Z ) is defined, i.e. a node X can have at most 2 children, which will be the roots of subtrees Y and Z.
In Option B :
After working on innermost (2 3 4), where 2 is a node of the binary tree, 3 is left subtree of node 2 and 4 is right subtree of node 2. From this we get (1 2 5 6). Here 2 has come from the root of subtree ( 2 3 4 ). Now again we don’t have any definition for ( 1 2 5 6). Hence invalid
In Option D :
(4567) doesn’t follow the rule (XYZ).
In Option C:
After working on ( 2 3 4) and ( 5 6 7 ) we get ( 1 2 5 ) where 2 has come from the root of subtree ( 2 3 4 ) and 5 has come from the root of subtree ( 5 6 7 ). Now, in ( 1 2 5 ) node 1 is the root of the binary tree, and subtree with root 2 is the left subtree and subtree with root 5 is the right subtree at root node 1. Hence it is giving valid binary tree.
So according to the representation we will only be able to draw binary tree for option c.
Now look at the figures you have constructed. Since you were able to draw binary tree for options a & d they also seem to be a valid binary tree because in your figure, both these trees follow the Rule of at most 2 childern.
I hope you understood how to solve this question.