Ejemplo n.º 1
0
bst.insert(75, 'seventy five')
bst.insert(80, 'eighty')
bst.insert(81, 'eighty one')
bst.insert(79, 'seventy nine')
bst.insert(77, 'seventy seven')
bst.insert(65, 'sixty five')
# bst.insert(76, 'seventy six')
bst.insert(30, 'thirty')
bst.insert(20, 'twenty')
bst.insert(32, 'thirty two')
bst.insert(15, 'fifteen')
bst.insert(18, 'eighteen')
bst.insert(22, 'twenty two')
# bst.insert(28, 'twenty eight')
# bst.insert(31, 'thirty one')
bst.print_self()
# bst.insert(30, 'thirty')
# bst.insert(50, 'fifty')
# bst.insert(45, 'forty five')
# bst.insert(41, 'forty one')
# bst.insert(46, 'forty six')
# bst.insert(75, 'seventy five')
# min = bst.find_min()
# max = bst.find_max()
# print('max', max.value)
# print(min.value)
# result = bst.remove(30)
# print(result)
# print(bst.find_min().value)
# result = bst.remove(70)
# print(result)