No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
Hello, I have a question: [CODE] Algorithm DFS(Vertex V) mark[V] := 1; print[V]; for each (edge (V, W)) do if mark[W] = 0; DFS(W); [/CODE] I would like to realize this recursive procedure (depth-first search), but in my graph representation (with adjacency lists) I use two different classes, one for … |
|
Hello, (this is not a homework). So, I've created a graph as adjacency lists: [CODE] class Edge; class Vertex { public: Vertex* vNext; Edge* adjList; char FirstElement; bool marked; Vertex(char a) : FirstElement(a), vNext(NULL), adjList(NULL), marked(false) { } }; class Edge { public: Edge* eNext; int weight; char SecondElement; bool … |
|
Hello everybody, I would link to represent a graph with incidence lists. This picture is what I've thought about: [URL="http://img697.imageshack.us/img697/2640/incidence.jpg"]http://img697.imageshack.us/img697/2640/incidence.jpg[/URL] This is what I created: [CODE] #include <cstdlib> #include <iostream> using namespace std; class Edge; class Pointer; class Node { public: Node* nNext; Pointer* incList; char First; Node(char a) : … |