hello
my problem this time is i have an multidimensional vector and the example of adj vector is showen in the attached picture
and i wanna know the size of each one i mean in i=0 the size is 2
i declare a new vector degree to put in it the size as shown in the code:
vector<int> degree;
for(int i=0; i <n ; i++ )
{
degree[i] = adj[i].size();
}
cout << "the degree are: \n";
for (int i = 0; i < n; ++i) {
cout << degree.at(i) << ", ";
}
but when i compile it i get this error
any helpful ideas? i'll really appreciate the help thanks in advance :)