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.

Implement the ordered dictionary ADT us<strong>in</strong>g an ordered list.<br />

P-9.4<br />

Implement the methods of the ordered dictionary ADT us<strong>in</strong>g a skip list.<br />

P-9.5<br />

Extend the previous project by provid<strong>in</strong>g a graphical animation of the skip list<br />

operations. Visualize how entries move up the skip list dur<strong>in</strong>g <strong>in</strong>sertions <strong>and</strong> are<br />

l<strong>in</strong>ked out of the skip list dur<strong>in</strong>g removals. Also, <strong>in</strong> a search operation, visualize<br />

the scan-forward <strong>and</strong> drop-down actions.<br />

P-9.6<br />

Implement a dictionary that supports location-aware entries by means of an<br />

ordered list.<br />

P-9.7<br />

Perform a comparative analysis that studies the collision rates for various hash<br />

codes for character str<strong>in</strong>gs, such as various polynomial hash codes for different<br />

values of the parameter a. Use a hash table to determ<strong>in</strong>e collisions, but only<br />

count collisions where different str<strong>in</strong>gs map to the same hash code (not if they<br />

map to the same location <strong>in</strong> this hash table). Test these hash codes on text files<br />

found on the Internet.<br />

P-9.8<br />

Perform a comparative analysis as <strong>in</strong> the previous exercise but for 10-digit<br />

telephone numbers <strong>in</strong>stead of character str<strong>in</strong>gs.<br />

P-9.9<br />

Design a <strong>Java</strong> class that implements the skip list data structure. Use this class to<br />

create implementations of both the map <strong>and</strong> dictionary ADTs, <strong>in</strong>clud<strong>in</strong>g<br />

location-aware methods for the dictionary.<br />

Chapter Notes<br />

Hash<strong>in</strong>g is a well-studied technique. The reader <strong>in</strong>terested <strong>in</strong> further study is<br />

encouraged to explore the book by Knuth [63], as well as the book by Vitter <strong>and</strong><br />

Chen [96]. Interest<strong>in</strong>gly, b<strong>in</strong>ary search was first published <strong>in</strong> 1946, but was not<br />

published <strong>in</strong> a fully correct form until 1962. For further discussions on lessons<br />

learned, please see papers by Bentley [12] <strong>and</strong> Levisse [67]. Skip lists were<br />

<strong>in</strong>troduced by Pugh [83]. Our analysis of skip lists is a simplification of a presentation<br />

given by Motwani <strong>and</strong> Raghavan [79]. For a more <strong>in</strong>-depth analysis of skip lists,<br />

580

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

Saved successfully!

Ooh no, something went wrong!