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

Operations on Single Link List<br />

INSERTION OPRETATION<br />

TO insert an element in the list, the first task is to get a free node, assign the<br />

element to be inserted to the info field of the node, and then new node is<br />

placed at the appropriate position by adjusting the appropriate pointer. The<br />

insertion in the list can take place at the following positions:‐<br />

at the beginning of the list<br />

at the end of the list<br />

after a given element<br />

Insertion has three steps:<br />

<strong>1.</strong> Create a new element to add to the list<br />

2. Find the record preceding the place it should go in the list<br />

3. Do the insertion<br />

Prepared By :­<br />

Er. Harvinder Singh<br />

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

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

Saved successfully!

Ooh no, something went wrong!