my code is not giving any output ,
pls help me out
💡 Tree bottom view
Hi Pritika ,
Please don’t copy codes from GeeksForGeeks. They complicate things rather than resolving them.
As for this problem , the problem is with your input function. You are taking a string input using cin . This will only take input till the first space character and your string will only have data for the first node and that’s it. You are trying to construct a tree using just one node and then finding the bottom view of that single node tree.
I am sharing my level order input function for the tree. Use it for your code and please write your own code for the bottom view. Its not that complicated.
Code for level order input of a tree - https://ide.codingblocks.com/s/98517
sir what is wrong in this code, i am not getting any output
Line No 29 and Line No 33.
Should you really be comparing two integer values with NULL . Shouldn’t it be comparison with -1 ?
I should let you know that while using codes from GeeksForGeeks and other such sites might show you a 100 points in that particular problem , you won’t get a full 100 points in your leaderboard due to the plagiarism checker. Same goes if you copy codes from your friends or from anywhere else. The plagiarism checker deducts your points if it finds that it is copied and hence there isn’t really any point in copying the codes then.
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.