I'm implementing a binary search tree from scratch to get a good feel for everything, and all of the functions work except for merge by copying. Actually, it does work when the the node to be deleted has two children, so the problem lies in the two lines
node = node->left;
and
node = node->right;
, which are commented in the code.
This is actually the code as my book has it written, and I don't see why it doesn't move all children up one node in the tree, replacing node with node's left child, or with its right child, depending. It seems to be a pretty simple way to delete a node with only one child. Am I looking at this the wrong way? I can post all code if desired. As usual, thanks in advance for any help or tips!