Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started