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.

Projects<br />

P-3.1<br />

Write a <strong>Java</strong> program for a matrix class that can add <strong>and</strong> multiply arbitrary twodimensional<br />

arrays of <strong>in</strong>tegers.<br />

P-3.2<br />

Perform the previous project, but use generic types so that the matrices <strong>in</strong>volved<br />

can conta<strong>in</strong> arbitrary number types.<br />

P-3.3<br />

Write a class that ma<strong>in</strong>ta<strong>in</strong>s the top 10 scores for a game application,<br />

implement<strong>in</strong>g the add <strong>and</strong> remove methods of Section 3.1.1, but us<strong>in</strong>g a<br />

s<strong>in</strong>gly l<strong>in</strong>ked list <strong>in</strong>stead of an array.<br />

P-3.4<br />

Perform the previous project, but use a doubly l<strong>in</strong>ked list. Moreover, your<br />

implementation of remove(i) should make the fewest number of po<strong>in</strong>ter hops<br />

to get to the game entry at <strong>in</strong>dex i.<br />

P-3.5<br />

Perform the previous project, but use a l<strong>in</strong>ked list that is both circularly l<strong>in</strong>ked<br />

<strong>and</strong> doubly l<strong>in</strong>ked.<br />

P-3.6<br />

Write a program for solv<strong>in</strong>g summation puzzles by enumerat<strong>in</strong>g <strong>and</strong> test<strong>in</strong>g all<br />

possible configurations. Us<strong>in</strong>g your program, solve the three puzzles given <strong>in</strong><br />

Section 3.5.3.<br />

P-3.7<br />

Write a program that can perform encryption <strong>and</strong> decryption us<strong>in</strong>g an arbitrary<br />

substitution cipher. In this case, the encryption array is a r<strong>and</strong>om shuffl<strong>in</strong>g of<br />

the letters <strong>in</strong> the alphabet. Your program should generate a r<strong>and</strong>om encryption<br />

array, its correspond<strong>in</strong>g decryption array, <strong>and</strong> use these to encode <strong>and</strong> decode a<br />

message.<br />

P-3.8<br />

Write a program that can perform the Caesar cipher for English messages that<br />

<strong>in</strong>clude both upper <strong>and</strong> lowercase characters.<br />

210

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

Saved successfully!

Ooh no, something went wrong!