10.09.2013 Views

1. Advanced Data Structure using C++

1. Advanced Data Structure using C++

1. Advanced Data Structure using C++

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.

LECTURE NOTES OF ADVANCED DATA STRUCTURE (MT-CSE 110)<br />

Consider the following tree:<br />

5<br />

3 10<br />

2 4 6 15<br />

1 8 13 20<br />

12<br />

A left rotate of node 10 requires the following:<br />

1) 10’s right child (15) rises up to replace 10.<br />

2) This orphans 15’s left children (13 and 12), but…<br />

3) 10 becomes the left child of 15 and adopts 12 and 13, producing the following<br />

tree.<br />

5<br />

3 15<br />

2 4 10 20<br />

1 6 13<br />

8 12<br />

Prepared By :­<br />

Er. Harvinder Singh<br />

Assist Prof., CSE, H.C.T.M (Kaithal) Page ‐ 203 ‐

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

Saved successfully!

Ooh no, something went wrong!