Skip to content

Commit 9dd7550

Browse files
return the value, not the index, to be consistent with above (williamfiset#271)
1 parent 6bd2d44 commit 9dd7550

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/williamfiset/algorithms/search/TernarySearchDiscrete.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static double discreteTernarySearch(int lo, int hi) {
4141
} else if (res1 > res2) lo = mid1;
4242
else hi = mid2;
4343
}
44-
return lo;
44+
return f(lo);
4545
}
4646

4747
public static void main(String[] args) {

0 commit comments

Comments
 (0)