codeLink: https://pastebin.com/UTAcY4zM
my code is not producing any output, I am unable to debug it ,please correct it.
Tree top view code problem
@Divya_321 i found two mistakes in your code, i have corrected them and attached the link.
- while building the tree, you were not popping from the queue.
- while checking for NULL in the top view function, the order of the if condition was not correct. you first have to check for NULL and then for the level. otherwise it will give a segfault.
https://ide.codingblocks.com/s/184044
1 Like
thank you cleared my doubts 