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.

any other node of T. A node of T with m<strong>in</strong>imum eccentricity is called a center<br />

of T.<br />

a.<br />

Design an efficient algorithm that, given an n-node free tree T, computes a<br />

center of T.<br />

b.<br />

C-13.7<br />

Is the center unique? If not, how many dist<strong>in</strong>ct centers can a free tree have?<br />

Show that, if T is a BFS tree produced for a connected graph G, then, for each<br />

vertex v at level i, the path of T between s <strong>and</strong> v has i edges, <strong>and</strong> any other path<br />

of G between s <strong>and</strong> v has at least i edges.<br />

C-13.8<br />

The time delay of a long-distance call can be determ<strong>in</strong>ed by multiply<strong>in</strong>g a small<br />

fixed constant by the number of communication l<strong>in</strong>ks on the telephone network<br />

between the caller <strong>and</strong> callee. Suppose the telephone network of a company<br />

named RT&T is a free tree. The eng<strong>in</strong>eers of RT&T want to compute the<br />

maximum possible time delay that may be experienced <strong>in</strong> a long-distance call.<br />

Given a free tree T, the diameter of T is the length of a longest path between<br />

two nodes of T. Give an efficient algorithm for comput<strong>in</strong>g the diameter of T.<br />

C-13.9<br />

A company named RT&T has a network of n switch<strong>in</strong>g stations connected by m<br />

high-speed communication l<strong>in</strong>ks. Each customer's phone is directly connected<br />

to one station <strong>in</strong> his or her area. The eng<strong>in</strong>eers of RT&T have developed a<br />

prototype video-phone system that allows two customers to see each other<br />

dur<strong>in</strong>g a phone call. In order to have acceptable image quality, however, the<br />

number of l<strong>in</strong>ks used to transmit video signals between the two parties cannot<br />

exceed 4. Suppose that RT&T's network is represented by a graph. Design an<br />

efficient algorithm that computes, for each station, the set of stations it can<br />

reach us<strong>in</strong>g no more than 4 l<strong>in</strong>ks.<br />

C-13.10<br />

Expla<strong>in</strong> why there are no forward nontree edges with respect to a BFS tree<br />

constructed for a directed graph.<br />

C-13.11<br />

874

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

Saved successfully!

Ooh no, something went wrong!