Recover binary search tree

i am unable to form the code for this
problem.
pls tell the correct code.

@yutikakhanna hey ,here is code for reference.
https://ideone.com/Od0MrX

i have tried implementing it.

i have tried implementing it. but showing many errors.

@yutikakhanna hey ,ye sirf mene function bheja hai ,apko tree build krke function me uski root dalni pdegi agr fir bhi dikkt arhi hai than I will help you.