When i remove the root of the binary tree and I view the binary tree in In-Order Traversal, my program will stop running.
Then you are not resetting the links the way they should be. Removing the root means replacing the root with either the inorder predecessor or successor. Something like this:
Original:
D
B F
A C E G
Delete the root:
*
B F
A C E G
Make the inorder predecessor the root:
C
B F
A * E G
Delete the inorder predecessor:
C
B F
A E G That behavior should fall out of your deletion algorithm because it is the same as the two child case for any node. But you also need to reset the root pointer. In the example above, if root still points to D after the algorithm finishes, the tree will be broken. So at the end, the address of C should be assigned to root to finish things up, but only if it was D that was deleted. That is an easy test because parent will be NULL if the root has a matching value.