heyy i m trying y to build a treefrom level order. but its not working. please tell what is the prblm with the code.
Wrong output!//////
@Aparna
hello aparna,
can u please paste the problem here.
i am not able to see input and output format

Input Format Level order input for the binary tree will be given. Constraints No of nodes in the tree can be less than or equal to 10^7 Output Format A single line containing space separated integers representing the left view of the tree Sample Input 1 2 3 4 5 -1 6 -1 -1 -1 -1 -1 -1 Sample Output 1 2 4 Explanation The tree looks like 1 / \ 2 3 / \ \ 4 5 6 When viewed from the left , we would see the nodes 1,2 and 4.
@Aparna
ur logic is wrong .
u are given level order traversal and u need to form binary tree(need not to be bst) from it.
to construct tree from level order refere this -> https://www.geeksforgeeks.org/create-a-tree-in-level-order/
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.