There are 3 functions in the Tree class which work in my algo. I saw the algo to build tree from Level order from CB Discussion site and implemented it. When I ran it on my custom tree input, wrong tree is being constructed, although on dry run, I think it’s correct. The other 2 functions are working as expected, and they give the correct bottom view corresponding to the constructed tree. Please check why a wrong tree is getting constructed.
here’s the code: