I am currently trying to write my own Depth First Search. I have created a class called node.
class node{
private:
bool is_visited;
<data structure to collect edges>
public :
size_t get_number_of_edges();
void set_is_visited( bool val);
bool get_is_visited();
};
Node is basically a vertex for DFS. I still have to make another class DFS, which will place this node in its private member (I will cross this bridge latter). This node has to store the address of other nodes (edges). I was wondering what data structure should I use to save the address of edges.
I was thinking of using vector.
vector<node*> collect_edges;
or should I use list ?
list<node*> collect_edges;
I personally don't see any difference.