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 />

Post‐Order Traversal: To traverse a non‐empty binary tree in postorder, perform<br />

the following operations recursively at each node:<br />

<strong>1.</strong> Traverse the left subtree.<br />

2. Traverse the right subtree.<br />

3. Visit the node.<br />

Finally, trees can also be traversed in level‐order, where we visit every node on<br />

a level before going to a lower level. This is also called Breadth‐first traversal<br />

Example:<br />

Example:<br />

Output of Pre‐Order Traversal:<br />

F, B, A, D, C, E, G, I, H (root, left, right)<br />

Prepared By :­<br />

Er. Harvinder Singh<br />

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

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

Saved successfully!

Ooh no, something went wrong!