Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
vector<int> r1;
vector < vector<int> > AdjMat;
AdjMat.push_back(r1);
AdjMat[0].push_back(1234);
// 10 x 20 matrix:
vector< vector<int> > AdjMat1(10, vector<int>(20));
// 10 empty vectors:
vector< vector<int> > AdjMat2(10);
// Resize 10 x 20 matrix to 30 x 30, setting new entries to 5:
int len = AdjMat1.size();
for (int i = 0; i < len; i++)
{
AdjMat1[i].resize(30, 5);
}
AdjMat1.resize(30, vector<int>(30, 5));
// or resize 10 x 20 matrix to 30 x 30 full of the number 5:
{
vector< vector<int> > tmpMat(30, vector<int>(30, 5));
AdjMat1.swap(tmpMat);
}