if element is 0 in matrix then entire row and column should be set to 0

i got this from sumwhr

void makeRowColZero(int (*a)[COL])
{
        int i, j, k;
        k = 0;
        for(i = 0; i < ROW; i++)
                for(j = k; j < COL; j++)
                {
                        if(0 == a[i][j])
                        {
                                for(k = 0; k < ROW; k++)
                                        a[k][j] = 0;

                                for(k = 0; k < COL; k++)
                                        a[i][k] = 0;

                                i++;
                                j++;
                                k = j;
                                continue;
                        }
                }
}



in the end continue???it takes to loop start but if it is not used
even then we can go to start after the loop fiteration is over....

-- 
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