Skip to content

Commit 4d4ab19

Browse files
author
Fahham29
committed
Fix warning: explicit cast from double to int
1 parent 318d2bc commit 4d4ab19

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ public static int jumpSearch(int[] arr, int target) {
2424

2525
while (prev < n && arr[Math.min(step, n) - 1] < target) {
2626
prev = step;
27-
step += Math.floor(Math.sqrt(n));
27+
step += (int) Math.floor(Math.sqrt(n));
28+
2829
}
2930

3031
for (int i = prev; i < Math.min(step, n); i++) {

0 commit comments

Comments
 (0)