ObjectiveMcq
Print Protected
This page is protected for print. Use the website to view the content.
What is the formula used for calculating the position in interpolation search (x = element being searched, A[] = input array, low and high are the leftmost and rightmost index of A[] respectively)
Correct Answer: C — low + ((x - A[low]) * (high - low)) / (A[high] - A[low])
For calculating the position after each iteration in interpolation search we use the formula low + ((x - A[low]) * (high - low)) / (A[high] - A[low]). Then the value at the calculated position is compared with the element being searched.