Doubt in the algorithm

st[i][j] = f(st[i][j-1], st[i + (1 << (j - 1))][j - 1]);
here is the second term it should j and not j-1
why it is j-1
as we are doing i+2^j-1 and not i+2^j-1+1

hello @be10046.19
i think in code he have used j only .pls check

@aman212yadav he has used j-1 only

pls wait …

that j -1 is when we are breaking our problem in two parts.

for example to obtain min in 4 length subarry we are taking help of 2 lenght sub array.
thats why j-1.

2^2 (4 ) = 2^1 (2) + 2^1(2)

mat[i][j] = min( mat[i][j-1] , mat[i+1<<(j-1) ] [j-1] )
min of 0-3 is =min ( min of 0 -1 , min of 2 -3 )