There will be following changes to this

while(noOfCellsVisited<mn)
{
if(dir == 1)
{
for i = st_col to end_col
{ print arr[row][i]; noOfCellsVisited++}
dir++;
end_col--;
row = n-1-row;
}

else if(dir==2)
{
for i = st_row to end_row
{ print arr[i][col]; noOfCellsVisited++}
dir++;
end_row--;
col=n-1-col;
}

else if(dir==3)
{
for i = end_col to st_col
{ print arr[row][i]; noOfCellsVisited++}
dir++;
row=n-row;
st_col++;
}

else if(dir==4)
{
for i = end_row to st_row
{ print arr[i][col; noOfCellsVisited++}

}
dir=1;
col=n-1-(i+1);
st_row++;
}
}

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to