Tree bottom view

Hello,
my code is passing all test cases except one
I am unable to find error in it please help
my code : https://ide.codingblocks.com/s/679598

hi @akshatjain4545 logic batana apna

Hlo @talhashamim001,
I am applying logic similar to vertical order print just by mapping each vertical column(…-2,-1,0,1,2…) with its bottom most node’s data
and hence get lowest most element

hi @akshatjain4545 almost correct but,
not only level but u also need to store the width at which u r having node check this read on depth first search one

Hi @talhashamim001, Thanks for reference.
I read it but unable to figure out error in my approach for which it fails

hi @akshatjain4545 try this
14 14 3 -1 8 8 12 -1 6 17 3 -1 1 11 10 -1 6 6 13 -1 10 17 7 -1 11 7
ans is 7 6 7 13 11 10

which ordering is this, that’s not working fine

@talhashamim001 Hlo sr,