Graph Functions

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/3

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

4 Terms

1
New cards

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;
}


2
New cards

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;
}

3
New cards

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;
}
}

4
New cards

-

-