Please help me its not accepting the all tc what is error
what u are doing right now, it simply exchanging two consecutive values if they do not satisfy the condition for bst, but exchanging them will still not ensure a bst
suppose two random values from the right subtree and one from the left subtree are swapped, simpy exchanging the root with one of the exchanged values will not help
the code i have pasted gives the implementation of the right logic