Question: use java please 222-8-connected A Social network can be modeled as an undirected graph (vertexes are persons and edges record whether they know each other).

use java please

use java please 222-8-connected A Social network can be modeled as an

222-8-connected A Social network can be modeled as an undirected graph (vertexes are persons and edges record whether they know each other). We say that two persons are connected if there is a path connecting them. Given a social network, write an efficient method to determine if 2 persons are connected. The objective is to leverage pre-processing time to decrease the query time, i.e. assuming the graph is pre-processed, what is the least amount of time needed to check that Annie and Joe are connected? Your code should be commented to indicate the data structure used, and the resulting complexity

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!