py icon indicating copy to clipboard operation
py copied to clipboard

Delete method will not work for a val having only left branch, right branch will be None.

Open sndpmhr opened this issue 5 years ago • 0 comments

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

sndpmhr avatar Jan 05 '21 06:01 sndpmhr