Problem Statement: 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 of the BST.

BST is a tree in which every node in the left subtree have value lesser than the root node and nodes in the right subtree have value greater than the root node.

To delete a node in a BST:

  1. Find the node to be deleted.
  2. Remove it and replace it with its successor/predecessor and update the BST.

#java #problem-solving #binary-search-tree #coding

Java: How to Delete a Node in Binary Search Tree
3.05 GEEK