Why in c++ the template code is not coming where as in java it is coming

And if the pre order is given then why cant we check the order only if it is same it will be identical else not

Hey @gaurav_kumarWhich,

  1. What template code are you talking about?

  2. No, you have misunderstood this question:
    You are required to check if the trees are structurally identical or not.

    Example 1:
    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 53 false false true 73 false false

    Example 2:
    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

    Both are structurally identical. But your code returns false for first and true for second.
    Solution:
    Don’t compare the values of nodes.

  3. During competition or interview assessment, you sometimes need not write the complete code.
    You would have been required to complete a function.
    So, you should know how to do it with trees given.

Hope, this would help.
Give a like if you are satisfied.

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.