https://ide.codingblocks.com/s/62417
i am getting runtime error
Hi Anshu, pls review line no. 56,58 of your code. It is posing all the problem. Whenever you are inserting a node it gets set to root node’s left or right only. And the length of tree remains 2 always.
Hope this helps