Tree Top View Problem

output galat aa rha hai. Ana tha, 4 2 1 3
aa rha, 3 1 4 2 5

@Kinjal hey sorry I have seen your previous code,isme apne build wale function me hd use kia hai ,to root ka hd 0 se initialise nhi kia seedha left pr call ki and right pr islie tree nodes ke hd are not coming correct ,whereeas in bfs you have done correctly therefore woh chl rha tha ye nhi ,hope I have cleared your doubt and sorry for delay :slight_smile: