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.

LINK LIST<br />

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

LINK LISTS<br />

A linked list,or one‐way list, is a linear collection of data elements, called nodes,<br />

where the linear order is given by means of pointers. That is, each node is<br />

divided into two parts: the first contains the information of the elements, and<br />

the second part, called the link field or nextpointer field, contains the address of<br />

the next node in the list.<br />

The fig. is a schematic dia. Of a linked list with 6 nodes, Each node is pictured<br />

with two parts. The left part represents the information part of the node, which<br />

may contain an entire record of data items (e.g. NAME, ADDRESS, . . . .) the right<br />

part represents the nextpointer field of the node, and there is an arrow drown<br />

from it to the next node in the list .This follows the usual practice of drawing an<br />

arrow from a field to a node when the address of the node appears in the given<br />

field.<br />

Simple linked lists store dynamic variables in a single, one‐directional chain.<br />

data 1 data 2 data 3<br />

We want to create an ADT for simple linked lists with the following operations:<br />

• Create: Start a new list with nothing in it.<br />

• Insert: Add a record to the list.<br />

• Delete: Delete a record from the list.<br />

• Get Info: Find and return information from a record in the list.<br />

LINKED LIST STRUCTURE<br />

In sequential list representation,same kind of information are stored in a<br />

continuous memory addresses.<br />

Prepared By :­<br />

Er. Harvinder Singh<br />

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

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

Saved successfully!

Ooh no, something went wrong!