wat is meant by traversing a matrix
and also can any one tell me the concept of traversing a "matrix helically"??
This is a discussion on matrix within the C Programming forums, part of the General Programming Boards category; wat is meant by traversing a matrix and also can any one tell me the concept of traversing a "matrix ...
wat is meant by traversing a matrix
and also can any one tell me the concept of traversing a "matrix helically"??
When you traverse something, you walk it. When you traverse helically, you walk in a spiral. Thus, in the case of a matrix, you'd walk something like so:
Start at one, end up at nine.Code:789 612 543
Quzah.
Hope is the first step on the road to disappointment.
well a matrix is usually represented by a two dimensional array....traversing would mean looping through it ie:wat is meant by traversing a matrix
sets up a matrix and displays it.Code:#include <stdio.h> int main() { int r, c, matrix[6][6]; for (r=0;r<6;r++) for(c=0;c<6;c++) matrix[r][c]=(c+r) % 2; for (r=0;r<6;r++) { printf("{"); for(c=0;c<6;c++) if (c==0) printf("%d",matrix[r][c]); else printf("%3d",matrix[r][c]); printf("}\n"); } return 0; }
Last edited by nonpuz; 04-03-2004 at 03:53 AM.