23.11.2014 Views

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

Data Structures and Algorithms in Java[1].pdf - Fulvio Frisone

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

C-13.21<br />

Computer networks should avoid s<strong>in</strong>gle po<strong>in</strong>ts of failure, that is, network nodes<br />

that can disconnect the network if they fail. We say a connected graph G is<br />

biconnected if it conta<strong>in</strong>s no vertex whose removal would divide G <strong>in</strong>to two or<br />

more connected components. Give an O(n + m)-time algorithm for add<strong>in</strong>g at<br />

most n edges to a connected graph G, with n ≥ 3 vertices <strong>and</strong> m ≥ n − 1 edges,<br />

to guarantee that G is biconnected.<br />

C-13.22<br />

NASA wants to l<strong>in</strong>k n stations spread over the country us<strong>in</strong>g communication<br />

channels. Each pair of stations has a different b<strong>and</strong>width available, which is<br />

known a priori. NASA wants to select n − 1 channels (the m<strong>in</strong>imum possible) <strong>in</strong><br />

such a way that all the stations are l<strong>in</strong>ked by the channels <strong>and</strong> the total<br />

b<strong>and</strong>width (def<strong>in</strong>ed as the sum of the <strong>in</strong>dividual b<strong>and</strong>widths of the channels) is<br />

maximum. Give an efficient algorithm for this problem <strong>and</strong> determ<strong>in</strong>e its worstcase<br />

time complexity. Consider the weighted graph G = (V,E), where V is the<br />

set of stations <strong>and</strong> E is the set of channels between the stations. Def<strong>in</strong>e the<br />

weight w(e) of an edge e <strong>in</strong> E as the b<strong>and</strong>width of the correspond<strong>in</strong>g channel.<br />

C-13.23<br />

Suppose you are given a timetable, which consists of:<br />

•<br />

A set A of n airports, <strong>and</strong> for each airport a <strong>in</strong> A, a m<strong>in</strong>imum connect<strong>in</strong>g<br />

time c(a).<br />

•<br />

A set F of m flights, <strong>and</strong> the follow<strong>in</strong>g, for each flight f <strong>in</strong> F:<br />

˚<br />

Orig<strong>in</strong> airport a 1 (f) <strong>in</strong> A<br />

˚<br />

Dest<strong>in</strong>ation airport a 2 (f) <strong>in</strong> A<br />

˚<br />

Departure time t 1 (f)<br />

˚<br />

Arrival time t 2 (f).<br />

877

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!