1/3
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
bool hasEdge (Graph * graph, string X_ID, string Y_ID);
bool hasEdge (Graph * graph, string X_ID, string Y_ID){
int location = findVertex (graph, X_ID);
Edge curr = graph →verticies[location].firstEdge;
while(curr != NULL){
if(curr→destID == Y_ID){
return true;
}
curr = curr→nextEdge;
}
return false;
}
bool hasVertex(Graph * graph, string X_ID)
bool hasVertex(Graph * graph, string X_ID){
int location = findVertex(graph, X_ID);
if(location != -1) return true;
return false;
}
void connectedTo(Graph * graph, string X_ID)
void connectedTo(Graph graph, string X_ID){
int location = findVertex(graph, X_ID);
Edge curr = graph→verticies[location].firstEdge;
while(curr != NULL){
cout « curr→destID « endl;
curr = curr→nextEdge;
}
}
-
-