The following code is extracted from a binary search tree implementation, which statement is false about the code?
def insert(key, value):
def put(x, key, value):
if x == None:
return node(key, value)
if key < x.key:
x.left = put(x.left, key, value)
if key > x.key:
x.right = put(x.right, key, value)
if key == x.key:
x.value = value
return x
If search key is already present in the binary search tree, only the key is updated but not the value
Navigation through the binary search tree is done with the following code:
if key <x.key:
x.left = put(x.left, key, value)
if key > x.key:
x.right = put(x.right, key, value)
There is an inside recursive function in this function
If code encounters with a null link, it creates a new node