We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be0cd4f commit 0d08906Copy full SHA for 0d08906
dsa-solutions/Searching-Algorithms/Interpolation-Search.md
@@ -23,9 +23,9 @@ Interpolation Search is an efficient search algorithm for uniformly distributed
23
1. Initialize the low and high indices to 0 and N-1, respectively.
24
2. While the target value is within the range defined by the current low and high indices:
25
- Calculate the probe position using the formula:
26
- \[
+ $$
27
\text{pos} = \text{low} + \left( \frac{(x - \text{arr}[low]) \times (\text{high} - \text{low})}{\text{arr}[high] - \text{arr}[low]} \right)
28
- \]
29
3. Check the value at the probe position:
30
- If `arr[pos]` is equal to the target value, return `pos`.
31
- If `arr[pos]` is less than the target value, update `low` to `pos + 1`.
0 commit comments