do you see anything wrong with my code: #include "itinerary.h" #include "graph.h"…
- User
do you see anything wrong with my code: #include "itinerary.h" #include "graph.h" #include "graphUtils.h"
#include
using namespace std; using namespace boost;
Itinerary::Itinerary() : tripLength(0) { }
void Itinerary::addRoad(const Leg& roadSegment) { Vertex v1, v2;
if (verticesByName.find(roadSegment.fromCity) == verticesByName.end()) { v1 = boost::add_vertex(g); verticesByName[roadSegment.fromCity] = v1; } else { v1 = verticesByName[roadSegment.fromCity]; } if (verticesByName.find(roadSegment.toCity) == verticesByName.end()) { v2 = boost::add_vertex(g); verticesByName[roadSegment.toCity] = v2; } else { v2 = verticesByName[roadSegment.toCity]; } boost::add_edge(v1, v2, g); boost::add_edge(v2, v1, g);
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.