for (int h = 0; h < 4; h++) {
int minValue = a[h][0];
for (int i = h; i < h + 1; i++) {
for (j = w; j < w + 3; j++) {
if (a[i][j] < minValue) {
minValue = a[i][j];
}
}
}
System.out.println("Minimum Value = " + minValue);
}
I want to find seam carving but algorithim does not work well. As I know ı need to find minimum value under the selected index
I'm not sure your code will find the minimum seam: there is a "simple" dynamic programming approach to do that:
You can find the full code for a seam carver in Java here.