Skip to content

Latest commit

 

History

History
41 lines (19 loc) · 582 Bytes

File metadata and controls

41 lines (19 loc) · 582 Bytes

###Challenge 11

Language Version: Python 2.7.12

Solution

Algorithms ref:

http://www.algolist.net/Data_structures/Binary_search_tree/Removal

How to run

$ python bst.py

Please type in a list of node integer, seperated by space.

5 2 1 3 12 9 21 19 36

Original bst list:

[5, 2, 1, 3, 12, 9, 21, 19, 36]

Please type in key(s) you want to delete:

(you could type in one int, or a list of int like following, if the key is not in bst, you will also be notified.)

5 7 2 19

key 7 not found.

New bst list:

[9, 3, 1, 12, 21, 36]

###Testing

$ python unit_test.py