This is the delete function of binary search tree. However it won't enter the if-else statement that checks whether the node to be deleted is the left child or right child. Can someone please help?
void DeleteNode(node* T, int number)
{
node* x = new node;
node* current = new node;
node* dele = new node;
node* finder = new node;
finder = root;
while(finder!=NULL && number!=finder->key)
{
if(finder->key < number)
finder = finder->right;
else
finder = finder->left;
}
dele = finder;