#include "graph.h" #include #include #include int main(){ graph g; g.addVertex("Chicago"); g.addVertex("Atlanta"); g.addVertex("Denver"); g.addVertex("Dallas"); g.addEdge("Chicago", "Atlanta"); g.addEdge("Chicago", "Denver"); g.addEdge("Chicago", "Dallas"); node * nbrs = g.getNeighbors("Chicago"); node * temp = nbrs; while(temp != NULL){ cout << temp->data() << " "; temp = temp->link(); } cout << endl; list_clear(nbrs); nbrs = g.getNeighbors("Dallas"); temp = nbrs; while(temp != NULL){ cout << temp->data() << " "; temp = temp->link(); } cout << endl; list_clear(nbrs); return EXIT_SUCCESS; }