Structurally identical

Hey the input given in this question is of the form -

10 true 20 true 40 false false true 50 false false true 30 true 60 false false true 73 false false
10 true 20 true 40 false false true 50 false false true 30 true 60 false false true 73 false false

How can I take this input for two tree as there is no marking to indicate that input for first tree has ended and for second it has begun please specify here how can I take input properly

Hi @Divya_321

It is written in the question that the input is given in pre-order format, hence you can take input for the first tree till you reach the root again. Similarly you can do this for the second tree.

You can refer to this code for input: https://ide.codingblocks.com/s/182328

Hope it Helps.
Give a like, if you are satisfied. :slight_smile:

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.