Whats the problem im not getting value 15 even i haven't deleted it... Something missing in delete fun???? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

Whats the problem im not getting value 15 even i haven't deleted it... Something missing in delete fun????

https://code.sololearn.com/cA23A24a21a1/?ref=app

25th Dec 2020, 5:08 AM
Aditya Salabh
Aditya Salabh - avatar
2 Antworten
+ 1
yes, you have a problem in the delete function. in the first 'else' statement, you should test if 'cur_node.left is not none and cur_node.right is none' your code should look like this: if cur_node.left is None and cur_node.right is None: ... elif cur_node.left is not None and cur_node.right is None: ... elif cur_node.right is not None and cur_node.left is None: ... else: #both cur_node.left and cur_node.right are not None. ...
25th Dec 2020, 8:21 PM
John Robotane
John Robotane - avatar
0
John Robotane thnku so much..... Literally got irritated..... Thnku­čĹŹ
26th Dec 2020, 9:25 AM
Aditya Salabh
Aditya Salabh - avatar