subject

You have been hired by the university to manage the wireless network across campus. The network is set up as follows: there is one modem and many routers, which need to be connected together by cables. A router can only function if there is some path of cables (possibly through other routers) that connects it to the modem. Your job is to establish this network and keep all the routers functioning properly. There are many cables already in place between the routers, but they are old and malfunctioning. It is not within your budget to replace them with new cables, and so you will need to manage this network by repairing faulty cables. (Assume that it is possible to connect the whole network with these faulty cables and that all the cables can carry data in both directions.)You remember that you can use DFS to find a tree that connects every router to the modem. So, you run DFS from the modem (faulty cables are edges and the routers/modem are vertices) and repair all the tree edges of the DFS tree. Good job! We will denote this tree of now functioning cables as T. However, since these cables are old and prone to failure, one of them might stop working at any time! Therefore, the university wants to know how many malfunctioning cables can potentially replace a repaired cable in case it permanently fails. To formalize this, let e be some repaired cable. If this cable were removed, T would be split into two connected components. The modem would be in one of these components, and all the routers in the other component would no longer be connected to the modem! However, there may be other malfunctioning cables that connect these two components; therefore, repairing one of those cables will reconnect the network. The university wants to know how many such malfunctioning cables are there for each repaired cable. Give an algorithm (pseudocode) that computes all these counts (one for each edge in T) in O(m) time, where m is the total number of cables, both repaired and malfunctioning. You may assume that for a pair of routers/modem u and v, you can determine if u is an ancestor of v in T in O(1) time. Include some runtime analysis and proof of correctness.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 21:30
Im doing this last minute and literally none of my neighbors or people that my dad works with use excel so if anyone could me make up an example
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
Which option allows you to view slides on the full computer screen?
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
This question involves a class named textfile that represents a text file. public class textfile { private string filename; private string filename; private arraylist words; // constructors not shown // postcondition: returns the number of bytes in this file public int filesize() { } // precondition: 0 < = index < words.size() // postcondition: removes numwords words from the words arraylist beginning at // index. public void deletewords(int index, int numwords) { } // precondition: 0 < = index < = words.size() // postcondition: adds elements from newwords array to words arraylist beginning // at index. pub lic voidaddwords(int index, string[] newwords) { } // other methods not shown } complete the filesize() method. the filesize() is computed in bytes. in a text file, each character in each word counts as one byte. in addition, there is a space in between each word in the words arraylist, and each of those spaces also counts as one byte. for example, suppose the words arraylist stores the following words: { mary had a little lamb; its fleece was white as snow. } the filesize() method would compute 4 + 3 + 1 + 6 + 5 + 4 + 6 + 3 + 5 + 2 + 5 as the sum of the lengths of each string in the arraylist. the value returned would be this sum plus 10, because there would also be 10 spaces in between the 11 words. complete the filesize() method below: // postcondition: returns the number of bytes in this file public int filesize() { }
Answers: 1
You know the right answer?
You have been hired by the university to manage the wireless network across campus. The network is s...
Questions
question
Mathematics, 14.10.2019 08:02
question
Mathematics, 14.10.2019 08:02