educative.io

Looks like there is an error in your deletion code

currentNode and root point to the same memory, if you delete the memory that root is pointing at and then try to access currentNode, currentNode will will be pointing to junk memory.
if(root->value==currentNode->value){
delete root;
root=currentNode->leftChild;
return true;
}


Course: Data Structures for Coding Interviews in C++ - Learn Interactively
Lesson: Deletion in Binary Search Tree (Implementation) - Data Structures for Coding Interviews in C++