Linked list in C-Language

  • 1

Linked list in C-Language

Link List:

Link List is a collection of Nodes. Each node consists of a Data field and Address of Next field in the linked list.

Single Linked List consists of Data and Address of next field

Single Linked List consists of Data and Address of next field

Linked is used in case of dynamic memory allocation which avoids the concept of allocating memory to variables at compile time. In this case we can creae nodes at run time, so the memory allocattion will be done at run time.

Linked list can be developed using the user defined data types. i.e Structure

struct list {
int data;
struct list * next;
};

Here in above example list is the name of structure which contains two field data and next. data will contain the data to be entered by user and next field will contain the address of next node in the linked list.  Here next is pointer to structure which will be pointing to object of same type.

The various operations that we can perform on Linked List are:

1.  Create Linked List
2.  Insert a new node into Linked List at any desired position
3.  Delete a node from any desired location in a linked list
4.  Calculating length of a linked list
5.  Copy Linked List to another Linked List
6.  Reverse of a linked List
7.  Concatenation of two Linked Lists
8.  Searching an element in a linked list
9.  Sorting of a Linked List

All these programs are going to be published on this website soon, Linked List users stay tuned with this website, the programs will be written in C-Language.

Bookmark and Share