Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am trying to figure out the algorithm for this program. I am trying to impleme

ID: 3871380 • Letter: I

Question

I am trying to figure out the algorithm for this program. I am trying to implement the union algorthim without using any librarys or list. Basic nested for loops, while, and if.

What Ive done so far is create a 2d array [n][n] , n being the number of computers on the network.

My next step i initialize all of them to 0

Then I set the first colum index [0] :, 0 to (n-1)

Then what i get confused is how to implement the union algortim to move all the value of a row into the connected edge.

And of course the last step is to just search for the infected computer in one of the rows, when it finds it, output the number of computers in that row not inlcuding the computer that got infected. Assuming that the computer is not always the first computer connected in the network.

Program 2: Make a simple program that counts infected computers on a computer network. The virus spreads through the network, and every computer that is connected to an infected computer is infected. For example, there are seven computers and connected like the figure below. If computer #1 is infected, computer #3 and 6 will be infected through infection of computer #2 and 5. Computer #4 and 7 are safe. So, totally four computers are infected. Please implement your algorithm in Java but not use API. 6 Input In the first line, a number of computers is given and it's less than 100. The second line is a number of edges that represents a connection between two computers. After second line, each 1ine has two numbers that represent two

Explanation / Answer

Main.java

List.java

InfectedComputers.java

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote