What is a BST? Insert and delete a node from a BST (dry-run on a sample BST).
Asked in the Technical interview 1 stage.
Represent each tree node as [value, left, right], where an empty child is null. Implement the function below to insert insert_value, then delete delete_value, and return the resulting tree. Ignore duplicate insertions and leave the tree unchanged if the deletion value is absent.
bst_insert_delete(root, insert_value, delete_value)
Return the resulting nested-list tree representation.
def bst_insert_delete(root, insert_value, delete_value):