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.29<br />

Let G be a graph with n vertices <strong>and</strong> m edges such that all the edge weights <strong>in</strong> G<br />

are <strong>in</strong>tegers <strong>in</strong> the range [1,n]. Give an algorithm for f<strong>in</strong>d<strong>in</strong>g a m<strong>in</strong>imum<br />

spann<strong>in</strong>g tree for G <strong>in</strong> O(mlog* n) time.<br />

Projects<br />

P-13.1<br />

Write a class implement<strong>in</strong>g a simplified graph ADT that has only methods<br />

relevant to undirected graphs <strong>and</strong> does not <strong>in</strong>clude update methods, us<strong>in</strong>g the<br />

adjacency matrix structure. Your class should <strong>in</strong>clude a constructor method that<br />

takes two collections (for example, sequences)—a collection V of vertex<br />

elements <strong>and</strong> a collection E of pairs of vertex elements—<strong>and</strong> produces the graph<br />

G that these two collections represent.<br />

P-13.2<br />

Implement the simplified graph ADT described <strong>in</strong> Project P-13.1, us<strong>in</strong>g the<br />

adjacency list structure.<br />

P-13.3<br />

Implement the simplified graph ADT described <strong>in</strong> Project P-13.1, us<strong>in</strong>g the<br />

edge list structure.<br />

P-13.4<br />

Extend the class of Project P-13.2 to support update methods.<br />

P-13.5<br />

Extend the class of Project P-13.2 to support all the methods of the graph ADT<br />

(<strong>in</strong>clud<strong>in</strong>g methods for directed edges).<br />

P-13.6<br />

Implement a generic BFS traversal us<strong>in</strong>g the template method pattern.<br />

P-13.7<br />

Implement the topological sort<strong>in</strong>g algorithm.<br />

P-13.8<br />

Implement the Floyd-Warshall transitive closure algorithm.<br />

880

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

Saved successfully!

Ooh no, something went wrong!