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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

_<br />

_<br />

_<br />

_<br />

F<strong>in</strong>d which bridges to build to m<strong>in</strong>imize the total construction cost.<br />

R-13.19<br />

Draw a simple, connected, undirected, weighted graph with 8 vertices <strong>and</strong> 16<br />

edges, each with unique edge weights. Illustrate the execution of Kruskal's<br />

algorithm on this graph. (Note that there is only one m<strong>in</strong>imum spann<strong>in</strong>g tree for<br />

this graph.)<br />

R-13.20<br />

Repeat the previous problem for the Prim-Jarník algorithm.<br />

R-13.21<br />

Consider the unsorted sequence implementation of the priority queue Q used <strong>in</strong><br />

Dijkstra's algorithm. In this case, why is this the best-case runn<strong>in</strong>g time of<br />

Dijkstra's algorithm O(n 2 ) on an n-vertex graph?<br />

R-13.22<br />

Describe the mean<strong>in</strong>g of the graphical conventions used <strong>in</strong> Figure 13.6<br />

illustrat<strong>in</strong>g a DFS traversal. What do the colors blue <strong>and</strong> black refer to? What do<br />

the arrows signify? How about thick l<strong>in</strong>es <strong>and</strong> dashed l<strong>in</strong>es?<br />

R-13.23<br />

Repeat Exercise R-13.22 for Figure 13.7 illustrat<strong>in</strong>g a BFS traversal.<br />

R-13.24<br />

Repeat Exercise R-13.22 for Figure 13.9 illustrat<strong>in</strong>g a directed DFS traversal.<br />

R-13.25<br />

Repeat Exercise R-13.22 for Figure 13.10 illustrat<strong>in</strong>g the Floyd-Warshall<br />

algorithm.<br />

R-13.26<br />

871

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

Saved successfully!

Ooh no, something went wrong!