This is Discussion thread about Remove the leaves ( Binary Tree )
Discussion About Remove the leaves ( Binary Tree )
I am unable to understand how the program is taking an input.
1 Like
Here the program is taking input recursively.
First root data is inputted.
Then if “true” is written, then left of root exists.
Then input data of left and so on.
Similary after left subtree, if “true” is written then the right of root exists.
Then input data on right subtree recursively.
You can view how the input is performed in the given JAVA editor of the problem statement.
Don’t think much bro. Just try to remove the leaves from the given root Node. Don’t think more on input just focus upon the function implementation.
@Sudhanshu_S_Mallick-204469167159957 @abhishek.09091 can you please give me the total code of this program i am unable to find the solution…!!