11.07.2015 Views

Data Structures and Algorithm Analysis - Computer Science at ...

Data Structures and Algorithm Analysis - Computer Science at ...

Data Structures and Algorithm Analysis - Computer Science at ...

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.

Sec. 13.3 Sp<strong>at</strong>ial <strong>D<strong>at</strong>a</strong> <strong>Structures</strong> 44117179292G259925P991842G1889S72P7289S42 7575(a)(b)17 P8989 S17922592259918 729918 724275(c)42 75(d)Figure 13.10 Example of splaying after performing a search in a splay tree.After finding the node with key value 89, th<strong>at</strong> node is splayed to the root by performingthree rot<strong>at</strong>ions. (a) The original splay tree. (b) The result of performinga zigzig rot<strong>at</strong>ion on the node with key value 89 in the tree of (a). (c) The resultof performing a zigzag rot<strong>at</strong>ion on the node with key value 89 in the tree of (b).(d) The result of performing a single rot<strong>at</strong>ion on the node with key value 89 in thetree of (c). If the search had been for 91, the search would have been unsuccessfulwith the node storing key value 89 being th<strong>at</strong> last one visited. In th<strong>at</strong> case, thesame splay oper<strong>at</strong>ions would take place.

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

Saved successfully!

Ooh no, something went wrong!