py
py copied to clipboard
Delete method will not work for a val having only left branch, right branch will be None.
https://github.com/codebasics/py/blob/4fd3f62794e5f7cca9efaf2f835239b6213afef7/DataStructures/9_Binary_Tree_2/Exercise/binary_tree_part_2_exercise.py#L64
If self.right is None: return self.left
Example: data_elements = [17, 5, 2, 23, 18, 34] Try to delete element 5