Question: Can you help me fix my connected components method? / * * * finds the fewest connected components of a graph * @param ag the
Can you help me fix my connected components method?
finds the fewest connected components of a graph
@param ag the AirlineGraph graph representing the airline system
@return a possibly empty Set of connected components.
Each connected component is a Set of airport codes in the component.
public Set connectedComponentsAirlineGraph ag;
Test Failed! Loading routes from file
Your solution: DIFCLNBYBUVD FYE, EAQ, IOZ, WDG SMF ELF Expected solution: CLNDIF UVD, FYE, EAQ, IOZ, BYB WDG SMF ELF
This is my output vs what it should be
I was also supposed to use bfs I have pseudocode,
Pseudocode
BFSvertex v
Q new Queue
add v to Q
whileQ is not empty
w remove head of Q
visit w
seenw true mark w as visited
for each unseen neighbor x
seenx true mark x as seen
add x to Q
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
