Polish bst challenge and solution

Add root is None input test case.  Update time and space complexity discussion.
This commit is contained in:
Donne Martin
2016-03-01 07:03:37 -05:00
parent 56f8ea1e74
commit de0e70de4f
4 changed files with 30 additions and 17 deletions

View File

@@ -11,6 +11,9 @@ class Node(object):
def insert(root, data):
if root is None:
root = Node(data)
return root
if data <= root.data:
if root.left is None:
root.left = Node(data)