美文网首页
450. Delete Node in a BST

450. Delete Node in a BST

作者: 我是你的果果呀 | 来源:发表于2016-12-29 11:24 被阅读0次

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 into two stages:
Search for a node to remove.
If the node is found, delete the node.
Note:Time complexity should be O(height of tree).

相关文章

网友评论

      本文标题:450. Delete Node in a BST

      本文链接:https://www.haomeiwen.com/subject/uwguvttx.html