Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribedimage text in transcribedIn 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions