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.

Re<strong>in</strong>forcement<br />

R-14.1<br />

Describe, <strong>in</strong> detail, the <strong>in</strong>sertion <strong>and</strong> removal algorithms for an (a,b) tree.<br />

R-14.2<br />

Suppose T is a multi-way tree <strong>in</strong> which each <strong>in</strong>ternal node has at least five <strong>and</strong><br />

at most eight children. For what values of a <strong>and</strong> b is T a valid (a,b) tree?<br />

R-14.3<br />

For what values of d is the tree T of the previous exercise an order-d B-tree?<br />

R-14.4<br />

Show each level of recursion <strong>in</strong> perform<strong>in</strong>g a four-way, external-memory<br />

merge-sort of the sequence given <strong>in</strong> the previous exercise<br />

R-14.5<br />

Consider an <strong>in</strong>itially empty memory cache consist<strong>in</strong>g of four pages. How many<br />

page misses does the LRU algorithm <strong>in</strong>cur on the follow<strong>in</strong>g page request<br />

sequence: (2,3,4,1,2,5,1,3,5,4,1,2,3)?<br />

R-14.6<br />

Consider an <strong>in</strong>itially empty memory cache consist<strong>in</strong>g of four pages. How many<br />

page misses does the FIFO algorithm <strong>in</strong>cur on the follow<strong>in</strong>g page request<br />

sequence: (2,3,4,1,2,5,1,3,5,4,1,2,3)?<br />

R-14.7<br />

Consider an <strong>in</strong>itially empty memory cache consist<strong>in</strong>g of four pages. How many<br />

page misses can the r<strong>and</strong>om algorithm <strong>in</strong>cur on the follow<strong>in</strong>g page request<br />

sequence: (2,3,4,1,2,5,1,3,5,4,1,2,3)? Show all of the r<strong>and</strong>om c hoices your<br />

algorithm made <strong>in</strong> this case<br />

R-14.8<br />

Draw the result of <strong>in</strong>sert<strong>in</strong>g, <strong>in</strong>to an <strong>in</strong>itially empty order-7 B-tree, entries with<br />

keys (4,40,23,50,11,34,62,78,66,22,90,59,25,72,64,77,39,12), <strong>in</strong> this order.<br />

R-14.9<br />

Show each level of recursion <strong>in</strong> perform<strong>in</strong>g a four-way merge-sort of the<br />

sequence given <strong>in</strong> the previous exercise.<br />

907

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

Saved successfully!

Ooh no, something went wrong!