0% found this document useful (0 votes)
77 views

Linked List

A linked list is a data structure made up of nodes that are connected to each other via pointers. Each node contains data and a pointer to the next node. The last node's pointer is set to null. Linked lists allow dynamic memory allocation and efficient insertion/deletion without fixing the size in advance. There are three types of linked lists: singly linked lists where each node points to the next node; doubly linked lists where each node points to both the next and previous nodes; and circular linked lists where the last node points to the first node, forming a loop.

Uploaded by

Bubun Goutam
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
77 views

Linked List

A linked list is a data structure made up of nodes that are connected to each other via pointers. Each node contains data and a pointer to the next node. The last node's pointer is set to null. Linked lists allow dynamic memory allocation and efficient insertion/deletion without fixing the size in advance. There are three types of linked lists: singly linked lists where each node points to the next node; doubly linked lists where each node points to both the next and previous nodes; and circular linked lists where the last node points to the first node, forming a loop.

Uploaded by

Bubun Goutam
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Linked List:A linked list is the chain of nodes or date items connected by pointers and each node contains

a pointer pointing to the address of next node or data item. A linked list is an ordered list of data items. A link list is a collection of records of the same data type, and all such records are connected through pointers each record in a linked list has a pointer field pointing to the next record in the list. The pointer field in the last record of the list is assigned the null value. A pointer variable is used to point to the first record in the list.

Advantages of linked list: It is not necessary to know in advance the number of elements to be stored in the list and therefore, need not allocate. d as and when necessary. In a linked list, insertions and deletions can be handled efficiently without fixing the size of the memory in advance. An important advantage of linked lists over arrays is that the linked list uses exactly as much memory as it needs, and can be made to expand to fill all available memory locations if needed. Disadvantages: The traversal is sequential. Increased overhead for storing pointers for linking the data items.

Type of Linked List:There are three types of linked list: Singly linked list Doubly linked list Circular linked list Singly linked list:- In This type of linked list, each node contains two fields i.e. data and a link pointing to the next node in the list.

The first node in the list is pointed by a start pointer. The node in the list has a link pointer field containing a Null. Doubly Linked List:-In this type of linked list, each node contains and two links, one link pointing to the previous node and one link pointing to the next node. Doubly linked list can be traversed forward as well as well as backward.

Circular Linked List: Circular linked list are the linked lists which are obtained by linking the last node of the linked list to the first node of the list. In circular linked list, the last node does not contain the NULL pointer. Instead it contains the pointer of the first node.

You might also like