Update InterpolationSearch.md

This commit is contained in:
Aakash Panchal
2020-04-13 14:35:21 +05:30
committed by GitHub
parent 3e44828be8
commit 08a5a9a13f

View File

@@ -16,9 +16,9 @@ Now, by the equation to find a slope, below formula can be used to find $x$,
$\Large{\frac{y-y_1}{x-x_1} = \frac{y_2-y_1}{x_2-x_1}}$
$\therefore \Large{{x-x_1} =\frac{(y-y_1)\times (x_2-x_1)}{y_2-y_1}}$
$\Large{{x-x_1} =\frac{(y-y_1)\times (x_2-x_1)}{y_2-y_1}}$
$\therefore \Large{{x} =x_1 + \frac{(y-y_1)\times (x_2-x_1)}{y_2-y_1}}$
$\Large{{x} =x_1 + \frac{(y-y_1)\times (x_2-x_1)}{y_2-y_1}}$
In order to find a formula for arrays, we need to have some characteristics of data, other than it is sorted. Like, the given data follows linear distribution or exponential distribution or uniform distribution over some range.