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.

Figure 10.25: A propagat<strong>in</strong>g sequence of fusions<br />

<strong>in</strong> a (2,4) tree: (a) removal of 14, which causes an<br />

underflow; (b) fusion, which causes another underflow;<br />

(c) second fusion operation, which causes the root to<br />

be removed; (d) f<strong>in</strong>al tree.<br />

Performance of (2,4) Trees<br />

Table 10.3 summarizes the runn<strong>in</strong>g times of the ma<strong>in</strong> operations of a dictionary<br />

realized with a (2,4) tree. The time complexity analysis is based on the follow<strong>in</strong>g:<br />

• The height of a (2,4) tree stor<strong>in</strong>g n entries is O(logn), by Proposition 10.8.<br />

• A split, transfer, or fusion operation takes O(1) time.<br />

• A search, <strong>in</strong>sertion, or removal of an entry visits O(logn) nodes.<br />

Table 10.3: Performance of an n-entry dictionary<br />

realized by a (2,4) tree, where s denotes the size of the<br />

640

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

Saved successfully!

Ooh no, something went wrong!