mercredi 3 avril 2019

Graph implemented by adjacency matrix and nodes as generic type

I'm asking for tips/help for a c++ class project. I have to implement a direct graph class with an adjacency matrix for the edges, not a problem. The problem comes when the nodes of the matrix must be a generic type (string, int, char, etc..). I implemented a node struct (templated) to create an array of nodes with id(generic type) and node_number, so i can associate any node with the respective matrix row/column. I cannot use any kind list and i have to use only standardi c++ 11 library (no vector). Do you guys think it's a good implementation?

Aucun commentaire:

Enregistrer un commentaire