I have written a code that has passed all the test cases but I assumed left and right as -1 for the leaf node, could you please enhance my code and make the value of the left and right of the leaf node as null as in the case of a usual binary tree. The link for the code is: https://ide.codingblocks.com/s/445492
Queries regarding alternate solution
i dont get what you are trying to do…why do u need null?
i wanted to set the left and right child of leaf node as null (instead of the need to create a node for it and set its data to -1) , now could u please modify the code