if(current == pBST)

{

temp_p=current;

temp=current->right;


while(temp->left != NULL)

{

temp_p=temp;

temp=temp->left;

}


if(temp_p->left==temp)

temp_p->left=temp->right;

else

temp_p->right=temp->right;


swap(pBST, temp);

delete temp;

goto end;

}



지우려는 노드가 루트 노드일때는 기존에 사용되는 서브노드 2개가 있을 경우의 알고리즘으로는 에러가 나서 루트노드랑 서브노드 중에서 가장 큰놈의 위치를 바꿔서 지우는 코드를 짰는데 저것도 루트노드는 안지워지고 애꿏은 이상한 서브노드가 지워지내요 ㅇㅅㅇ