Question: In Java program Instructions Each person in the class of DeltaOmicron were asked to write on a sheet of paper who are his/her close contacts.

In Java program Instructions Each person in the class of DeltaOmicron wereasked to write on a sheet of paper who are his/her closeIn Java program

Instructions Each person in the class of DeltaOmicron were asked to write on a sheet of paper who are his/her close contacts. You are given this sheet of paper and were asked to determine how many clusters of contact are present in class DelteOmicron. Create a function/method named cc that will accept a string containing the close contacts and returns an int value representing the number of cluster. Use adjacency list. Note: If A close contact of B then B is also close contact of A. Sample Input "Alf:Bobby,Alf:Dominic, Alf:Che, Dominic:Dindo, Che:Dindo, Jan:Jax,JaxMario" Output: 2 Sample input "Alf:Bobby, Cheche:Dominic,Dindo:Edgar" Output: 3 Output: A: [B, C] B B: [A] A C: [A, D] , D: [C, E] C E: [D]

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!