Create tree ( Using preorder and inorder)

https://codeshare.io/2pVwX0
why is it not workingand can you tell me also what is display function in question refer to???

Hi @sanyamsri2001
In line no. 26 that is cout<right->data; you have missed to add endl at the end. So just change :
cout<right->data; to cout<right->data<<endl;
And display function is the same that you have written.