C++ vector, what does this code mean?

前端 未结 6 1169
谎友^
谎友^ 2021-01-23 22:27

I have this code:

 const int maxnodes = 5000;
 struct Edge 
 {
   int to, rev;
   int f, cap;
 };

 vector g[maxnodes];

This is qui

6条回答
  •  长发绾君心
    2021-01-23 23:18

    int nodes = maxnodes, src, dest;

    This means all are integer and nodes is initialized with maxnodes

    vector g[maxnodes] is the array of vector.

    Vector is like a dynamic array. g[x] will be pointing to a vector. g[x][y] will point to a Edge .

提交回复
热议问题