Help with error

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);

  1. don’t pass root by reference in modify function
  2. modify function logic is not correct
  3. print function is not according to question

Modified Code