Is it better to open the memory pool or a vector to save a graph?

Revision en1, by Inversentropir-36, 2020-05-29 05:00:06

Just like title, Is it better to open the memory pool or a vector to save a graph?

I personally like using Vector to save a graph...

I just learned graph theory, so I don't know how to use it. :(

memory pool:

struct Edge{
    int next;
    int to;
    int w;
};
void add(int u,int v,int w)  {  
    edge[cnt].w = w;  
    edge[cnt].to = v;  
    edge[cnt].next = head[u];  
    head[u] = cnt++;  
}  
Tags #graph theory, #data structure

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Inversentropir-36 2020-05-29 05:00:06 511 Initial revision (published)