// THIS CODE IS MY OWN WORK, IT WAS WRITTEN WITHOUT CONSULTING // A TUTOR OR CODE WRITTEN BY OTHER STUDENTS - Your Name // 1. Copy most of Bridge.java, rename class to MaxBridge, note that // it already detects all the bridge edges. Of course you'll need // to replace main. // 2. Get code to read graph from "movies.txt" from Movies.java, // and put that near start of your main(). // For your own testing purposes, you might read from filename args[0] // instead, if that is defined (args.length > 0). (For grading, // "movies.txt" ill always be the input filename.) // 3. Now think about how to modify the algorithm (in the constructor), // so that it can compute the size of each bridge edge, as it is // discovered. Note that to compute the size of a bridge edge e // (from v to w) it is enough to know: // * the size X of the DFS tree subtree rooted at w. // * the size Y of the connected component containing e. // You can figure out X just by looking at cnt and pre[], but for Y // you might have to run DFS twice (first pass just for CC sizes). // 4. Keep track of the largest bridge edge, and at the end announce // it (probably in main, after the constructor/algorithm is done). // Note that in some test inputs, it might not be in the first component // that you consider, so you should look at all components, just like // Bridge already does.