https://ide.codingblocks.com/s/237845, please debug and tell me the mistake
Build BST, getting infinite loop
@rohit267, your code is not correct , instead of taking n inputs you are taking 2^n inputs as you call for buildTree(n-1); two times, also you have to maintain property of bst that the left child is smaller than root and right child is greater than root
refer this code for more clarity:-
your code is giving wrong output, please check once before providing any code.
thank you very much vatsal