Consider the following variant of the find index method from Code Fragment
10.8, in the context of the SortedTableMap class:
def find index(self, k, low, high):
if high
return high + 1
else:
mid = (low + high) // 2
if self. table[mid]. key
return self. find index(k, mid + 1, high)
return self. find index(k, low, mid − 1)
Does this always produce the same result as the original version? Justify
your answer.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here