Quote:
Originally Posted by sania21
Hi!!
i have been working on the code given by you but,the loop startrow is moving downwards by adding 1,now i am trying to work on upper rows but i am unable to decrement the rowcount bcoz initialy the value of startrow is set to 0,so it is not getting decremented any solution for this?
Please let me know,or just give me some hint so that i could proceed. 
|
Try starting from the last row and decrement its value...
this:
Code:
for(int startRow = 0; startRow < matrix.length; startRow++)
to this:
Code:
//note it starts from the last (matrix.length-1 not matrix.length)
for(int startRow = matrix.length-1 ; startRow >= 0 ; startRow--)
BTW are sure you want to change startRow and not currentRow values or both?