View Single Post
  #11 (permalink)  
Old 06-25-2007, 07:57 AM
oubless oubless is offline
Newbie
 
Join Date: May 2007
Posts: 22
Rep Power: 6
oubless is on a distinguished road
Default

Quote:
Originally Posted by sania21 View Post
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?

Last edited by oubless; 06-25-2007 at 08:46 AM.
Reply With Quote