prob : https://hack.codingblocks.com/app/contests/2022/459/problem
sol: https://ide.codingblocks.com/s/419048
used the reverse inorder method but there is some bug
prob : https://hack.codingblocks.com/app/contests/2022/459/problem
sol: https://ide.codingblocks.com/s/419048
used the reverse inorder method but there is some bug
your insert function is also incorrect
your mistakes
1)
insert(root -> right, data);
correct statement
root->right=insert(root -> right, data);
Modified Code