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.

1<br />

3<br />

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

Struct tnode*right;<br />

};<br />

TWO OF REPRESENTING BINARY TREE ARE <br />

Linked representation of binary tree<br />

Array representation of binary tree<br />

Insertion in binary tree:<br />

A binary tree is constructed by the repeated insertion of new nodes into a<br />

binary tree structure. Insertion must maintain the order of the tree. That is,<br />

values to the left of a given node must be less than that node, and values to the<br />

right must be greater. Inserting into a non‐empty tree.:<br />

before insertion 5 after insertion 5<br />

4<br />

7<br />

Deletion in binary tree:<br />

8<br />

6 3<br />

1<br />

Prepared By :­<br />

Er. Harvinder Singh<br />

Assist Prof., CSE, H.C.T.M (Kaithal) Page ‐ 187 ‐<br />

4<br />

5<br />

7<br />

6<br />

8

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

Saved successfully!

Ooh no, something went wrong!