leetcode-450-Delete Node in a BST

Error:

  1. do not know how to do. We can have 3 situation: When we find the key in BST 1) only has left subtree, 2) only have right subtree, 3) both.
    In 1) and 2), we can just add such subtree to the root, but in 3), we should first its min. val in the right subtree, then delete the key root and replace min. to the root.
点赞