MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Function main

CPP/MatrixTraversing.cpp:46–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44
45
46int main() {
47 int t;
48 cin>>t;
49
50 while(t--)
51 {
52 int r, c;
53
54 cin>>r>>c;
55
56 vector<vector<int> > matrix(r);
57
58 for(int i=0; i<r; i++)
59
60 {
61 matrix[i].assign(c, 0);
62 for( int j=0; j<c; j++)
63 {
64 cin>>matrix[i][j];
65 }
66 }
67
68
69 Solution ob;
70
71 vector<int> result = ob.spirallyTraverse(matrix, r, c);
72
73 for (int i = 0; i < result.size(); ++i)
74 cout<<result[i]<<" ";
75
76 cout<<endl;
77
78 }
79
80 return 0;
81
82}

Callers

nothing calls this directly

Calls 2

spirallyTraverseMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected