Getting run error in test case 1 2 and 4

at line 183
use this
root= deleteInBST(root, delete_val);

so that changes done in function should reflect at main

Modified Code

i hope this help
if you have more doubts regarding this feel free to ask
if your doubt is resolved mark it as resolved from your doubt section inside your course