Documente Academic
Documente Profesional
Documente Cultură
Data Structureconsisting
of a group ofnodeswhich together
on
represent a sequence.
Data
Part
Pointer
Part
Node 1 has two part one data part which consists of the 5
as data and the second part which contain the address of the
next node (i.e it contain the address of the next node)
Node 3, being last node of the list holds NULL value in its second part.
Advantages
Limitations
Access time for individual element isO(n).
In linked list , each node should be accessed sequentially .
Difficulties arise in linked lists when it comes to reverse traversing.
Usage more memory due topointersrequiring extra storage space.
if(start==NULL)
{
start=new_node;
current=new_node;
}
else
{
current->next=new_node;
current=new_node;
}
printf("\nPress n to stop creating next node");
ch=getche();
}while(ch!='n');
}
Conclusion
Hence, linked list is a simplest form of data structure that could
be used to to implement several other commonabstract data
types,
includinglists(the
abstract
data
type),stacks,queues,associative arrays, etc.
Due to its dynamic nature , we only have to just create linked
list structure and memory will be allocated at run time. We
wont have to allocate memory at compile time. Memory is
allocated at run time as per requirement, so that Linked list
data structure provides us strong command on memory
utilization.
Reference
1.
2.
3.
4.