template void BST:: remove (const Comparable & x, BinaryNode * & t) { if (t == NULL) return; if (x < t->element) remove (t->left); else if (x > t->element) remove (t->right); else if (t->left != NULL && t->right != NULL) { t->element = findMin (t->right)->element; remove (t->element, t->right); } else { BinaryNode *oldNode = t; t = t->left != NULL ? t->left : t->right; delete oldNode; } }