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.

P-8.1<br />

Give a <strong>Java</strong> implementation of a priority queue based on an unsorted list.<br />

P-8.2<br />

Write an applet or st<strong>and</strong>-alone graphical program that animates both the<br />

<strong>in</strong>sertion-sort <strong>and</strong> selection-sort algorithms. Your animation should visu alize<br />

the movement of elements to their correct locations.<br />

P-8.3<br />

Write an applet or st<strong>and</strong>-alone graphical program that animates a heap. Your<br />

program should support all the priority queue operations <strong>and</strong> should visualize<br />

the swaps <strong>in</strong> the up-heap <strong>and</strong> down-heap bubbl<strong>in</strong>gs. (Extra: Vi sualize bottomup<br />

heap construction as well.)<br />

P-8.4<br />

Implement the heap-sort algorithm us<strong>in</strong>g bottom-up heap construction.<br />

P-8.5<br />

Implement the <strong>in</strong>-place heap-sort algorithm. Experimentally compare its<br />

runn<strong>in</strong>g time with that of the st<strong>and</strong>ard heap-sort that is not <strong>in</strong>-place.<br />

P-8.6<br />

Implement a heap-based priority queue that supports the follow<strong>in</strong>g addi tional<br />

operation <strong>in</strong> l<strong>in</strong>ear time:<br />

replaceComparator(c): Replace the current comparator with c.<br />

(H<strong>in</strong>t: Utilize the bottom-up heap construction algorithm.)<br />

P-8.7<br />

Develop a <strong>Java</strong> implementation of an adaptable priority queue that is based on<br />

an unsorted list <strong>and</strong> supports location-aware entries.<br />

P-8.8<br />

Develop a <strong>Java</strong> implementation of an adaptable priority queue that is based on a<br />

heap <strong>and</strong> supports location-aware entries.<br />

P-8.9<br />

Write a program that can process a sequence of stock buy <strong>and</strong> sell orders as<br />

described <strong>in</strong> Exercise C-8.1.<br />

511

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

Saved successfully!

Ooh no, something went wrong!