Skip to content

Commit be02240

Browse files
authored
Improve InterpolationSearch documentation with example (#7336)
docs: improve InterpolationSearch documentation
1 parent af1d9d1 commit be02240

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/java/com/thealgorithms/searches/InterpolationSearch.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/**
2+
* Interpolation Search estimates the position of the target value
3+
* based on the distribution of values.
4+
*
5+
* Example:
6+
* Input: [10, 20, 30, 40], target = 30
7+
* Output: Index = 2
8+
*
9+
* Time Complexity: O(log log n) (average case)
10+
* Space Complexity: O(1)
11+
*/
112
package com.thealgorithms.searches;
213

314
/**

0 commit comments

Comments
 (0)