can u plz tell me how to built tree from given input
Print level order zigzag
Here, true means having a child and false means having no child…
So for the given input :
10 true 20 true 40 false false true 50 false false true 30 true 60 false false true 73 false false
It means that, 10 is the root node, true means it has left child whose value is 20, further true means that 40 is the left child of 20, two times false means that 40 doesnt have the left and right child, true further means that 50 is the right child of 20…
two times false means that 50 doesnt have any left or right child… …further true means that 30 is the right child of 10…
This is how tree will be build…
So you can take a string value in the buildtree function and check if string is true or false, and based on that you can build your tree.