We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
If you hover of the submission results that failed, there will be a popup that appears, where you can download both the input and expected output for that test case.
You appear to have the correct output, but in the wrong order. The solution wants it "left-to-right" (which just so happens to be least-to-greatest since these are apparently
binary search trees).
Tree : Top View
You are viewing a single comment's thread. Return to all comments →
same question.. Expected output: 1 2 47 49 50 My output: 47 2 1 49 50
@niranjan_wad how did you manage to find the output? Since, it does not tell what is your output. do you know what is root of above question ?
If you hover of the submission results that failed, there will be a popup that appears, where you can download both the input and expected output for that test case.
You appear to have the correct output, but in the wrong order. The solution wants it "left-to-right" (which just so happens to be least-to-greatest since these are apparently binary search trees).
Try using TreeMap so the keys will be in sorted order
bro..first print traverse, then print that node. then u get correct order
first traverse,the print that node. u get correct order