I think I am getting the question wrong

What is meant by a balanced BST tree. Isn’t it just height adjusted where the difference between the number of left and right nodes is <= 1; I tried this. My solution goes like this, if its an odd numbered input if will got to the left of the root (right being NULL always wrt to the left of the root) and similary if its even then it goes to the right of the root. Consider it just two linked lists are joined to a common node (the root). Is this exactly what the question is asking?

Code : https://ide.codingblocks.com/s/107706

if u wanr to check BST then height didnt matter
but if u want to make a tree which is bst as well as the height difference<=1 then u have to make a AVL tree
u can check more on this


we cant say that we are inserting node at correct place first we place and then check if it is valid or not

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.