450. Delete Node in a BST
Delete Node in a BST - LeetCode 주어진 이진 탐색 트리 (BST)의 루트 노드 참조와 키 (값)가 주어집니다. 이 BST에서 주어진 키와 동일한 값을 가지는 노드를 삭제하고, 삭제한 후의 BST의 루트 노드 참조를 반환합니다. 삭제 과정을 다음과 같이 나눌 수 있습니다: 1. 삭제할 노드를 찾습니다. 2. 노드를 찾으면 삭제합니다. Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of the BST. Basically, the deletion can be divided i..
LeetCode
2023. 10. 29. 21:19