Can you please help with pattern , i cannot figure this out
Cant figure this one out
create a 2d matrix of size n * n and store 1 in first column. Now start iterating from second row and iterate columns till <=i and A[i][j] = A[i - 1][j] + A[i - 1][j + 1]. This way A is filled, then print only the lower half of A.
can’t we do it without using arrays I mean in the simple way as we were doing all the patterns , without storing them?
No you can’t because previous values determine the next values here, so you need a cache to store previous values
I mean arrays have not been taught yet, so is it not like that we have to do this question without using arrays?
Honestly, I don’t see any way out to do this question without any form of cache. And arrays is simplest among them all.
understandable thanks