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

1) Assign currentNode to previousNode<br />

2) Assign nextNode to currentNode<br />

3) Assign currentNodenext to nextNode<br />

4) Assign previousNode to currentNode<br />

These steps are repeated, till the last element becomes the current element.<br />

At this point , assign the address of the last element , held in variable<br />

currentNode, to head variable.<br />

Two‐way (Doubly) Linked Lists<br />

Two‐way linked lists make it easier to move backward (in addition to forward)<br />

in the list.<br />

Two‐way linked lists usually have a dummy node (called Head), with head and<br />

tail pointers already built‐in to the structure.<br />

The empty list looks like:<br />

Two_Way_Linked_List T;<br />

head<br />

data1 data2 data3<br />

Prepared By :­<br />

Er. Harvinder Singh<br />

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

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

Saved successfully!

Ooh no, something went wrong!