code–>
question–>
https://practice.geeksforgeeks.org/problems/boundary-traversal-of-binary-tree/1
it is showing segmentation fault
Boundary order traversal using bfs
no its showing segmentation fault
bro have u found what is wrong with code
hey @sheikhhaji18 the problem with your approach is that you are taking the leftmost part of the tree and not the leftview itself.
in left boundary leftview will come, just like we generate with queue and bfs we do. and same for the right as well.
you are just simply iterating and because of this you are missing many nodes in between.
please see the updated:
Happy Learning !!