# What are the updated values of high and low in the array if the element being searched is lower than the value at calculated index in interpolation search? (pos = current position)

+1 vote
What are the updated values of high and low in the array if the element being searched is lower than the value at calculated index in interpolation search? (pos = current position)

(a) low = pos + 1, high remains unchanged

(b) high = pos – 1, low remains unchanged

(c) low = low +1, high = high – 1

(d) low = pos +1, high = pos – 1

I have been asked this question in an online interview.

The above asked question is from Searching in chapter Searching of Data Structures & Algorithms II

+1 vote
by (614k points)
selected by

Correct choice is (b) high = pos – 1, low remains unchanged

For explanation: When the element being searched is lower than the value at the calculated position then in that case we update high and low remains unaltered. Updated value of high is high = pos – 1.

+1 vote
+1 vote
+1 vote
+1 vote