#include "digraph.h" digraph::digraph() { nextNode = graphNodes.begin(); } int digraph::getSize() { return graphNodes.size(); } void digraph::addNode(int n, int a) { node foundNode; node adjacentNode; for(vector::iterator i = graphNodes.begin(); i != graphNodes.end(); i++) { if(i->getKey() == n) { foundNode = *i; } } if(foundNode == NULL) { foundNode = new node(n); } for(vector::iterator i = graphNodes.begin(); i != graphNodes.end(); i++) { if(i->getKey() == n) { *adjacentNode = *i; } } if(adjacentNode == NULL) { adjacentNode = new node(a); } graphNodes.push_back(*foundNode); }