0% found this document useful (0 votes)
19 views15 pages

Ritesh

A linked list is a dynamic linear data structure consisting of nodes connected by pointers, with each node containing data and a reference to the next node. There are three main types of linked lists: singly linked lists, doubly linked lists, and circular linked lists, each with distinct characteristics and operations. Linked lists offer advantages such as dynamic sizing, efficient insertions and deletions, and better memory utilization compared to arrays, making them essential for various advanced data structures.

Uploaded by

hr.saini001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views15 pages

Ritesh

A linked list is a dynamic linear data structure consisting of nodes connected by pointers, with each node containing data and a reference to the next node. There are three main types of linked lists: singly linked lists, doubly linked lists, and circular linked lists, each with distinct characteristics and operations. Linked lists offer advantages such as dynamic sizing, efficient insertions and deletions, and better memory utilization compared to arrays, making them essential for various advanced data structures.

Uploaded by

hr.saini001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

 Linked List:_

 A Linked List is a linear data structure in which elements, called nodes, are
connected sequentially using pointers. Each node contains two components:

1. Data: The actual value or information stored in the node.


2. Pointer/Link: A reference or address pointing to the next node in the
sequence.
 Key Characteristics:

 Dynamic Size: The size of a linked list can grow or shrink dynamically
during runtime.

 Non-contiguous Memory: Nodes can be stored at non-contiguous


memory locations.

 Efficient Insertions/Deletions: Operations like insertion and deletion are


more efficient compared to arrays, especially when dealing with large
datasets.
Types of Linked List:-

 There are mainly three types of linked list , which are given below :-

o Singly Linked List

o Doubly Linked List

o Circular Linked List


Singly Linked List :-

 Defination :-

A singly linked list is a linear data structure consisting of a sequence of nodes,


where each node contains two parts:

1.Data: The value or information that the node stores.

2.Pointer (Next): A reference to the next node in the sequence. The last node in the
list has its pointer set to null , indicating the end of the list
 Characteristics of Singly Linked Lists:

•Dynamic Size: The list size can grow or shrink dynamically as nodes are added or
removed.

•Sequential Access: Traversing the list is done sequentially, starting from the head (the
first node).

•Head Node: The entry point of the list, pointing to the first node.
Operation On Singly Linked List :-

•Insertion: Add a node to the beginning, end, or specific position in the list.

•Deletion: Remove a node from the list.

•Traversal: Access nodes sequentially to read or modify data.


Doubly Linked List :-

 Defination :-

A doubly linked list is a linear data structure consisting of a sequence of nodes, where each
node contains three parts:

1. Data: The value or information that the node stores.

2. Pointer to the Next Node: A reference to the next node in the list.

3. Pointer to the Previous Node: A reference to the previous node in the list.
In a doubly linked list, each node is linked to both its predecessor and successor, allowing
traversal in both forward and backward directions.
 Characteristics of Doubly Linked Lists:

•Bidirectional Traversal: Nodes can be accessed both forward (next) and backward
(previous).

•Dynamic Size: The size of the list can grow or shrink dynamically as nodes are added
or removed.

•Head and Tail Nodes: The list has a starting node (head) and an ending node (tail).
Operation On Doubly Linked List :-

• Insertion: Nodes can be added at the beginning, end, or any specific position in the list.

• Deletion: Nodes can be removed from the beginning, end, or any specific position.

• Traversal: Nodes can be traversed in both directions (from head to tail or tail to head).
Circular Linked List :-

 Defination :-

A circular linked list is a variation of a linked list in which all nodes are connected in
such a way that the last node points back to the first node, forming a circular structure. It
can be implemented as either:

1. Singly Circular Linked List: Each node has a pointer to the next node, and the
last node points back to the first node.

2. Doubly Circular Linked List: Each node has pointers to both the next and the
previous nodes, with the first and last nodes connected in a circular manner.
 Characteristics of Circular Linked Lists:

• Cyclic Nature: The last node connects back to the first node, forming a loop.

• No NULL Pointer: Unlike linear linked lists, there is no NULL pointer in a


circular linked list.

• Traversal: Traversal can start at any node and continue indefinitely due to the
circular structure.
Operation On Circular Linked List :-

• Insertion: Nodes can be added anywhere in the list (beginning, end, or a specific
position).

•Deletion: Nodes can be removed from the list while maintaining the circular structure.

•Traversal: The list can be traversed continuously until the starting node is encountered
again.
 Advantage of linked list:-

•Dynamic Size:
Linked lists can grow or shrink dynamically during runtime by allocating or deallocating
memory. There is no need to specify the size in advance, unlike arrays.

•Efficient Insertions and Deletions:


Adding or removing elements from the beginning, middle, or end of a linked list is more
efficient compared to arrays since no shifting of elements is required.

•Memory Utilization:
Unlike arrays, which may reserve unused memory, linked lists use memory only for the
elements currently in the list. Each node is created when needed.
•No Fixed Size:
Arrays require a fixed size declaration at compile time. Linked lists are more flexible
and adapt to the number of elements dynamically.

•Efficient Pointer Operations:


Moving pointers or swapping nodes in a linked list is easier and requires less
computational overhead compared to managing indices in arrays.

•Multiple Data Types:


Linked lists can store elements of different data types (if designed using structures or
classes), unlike arrays that typically store homogeneous data.

•Implements Advanced Data Structures:


Linked lists are the building blocks for advanced data structures like stacks, queues,
deques, graphs, and hash tables.
Conclusion :-

Linked lists are a versatile and efficient data structure that provide dynamic memory
allocation and ease of modification. Their ability to grow and shrink in size, combined
with efficient insertions and deletions, makes them ideal for applications where
flexibility is key. However, the sequential access and overhead of pointers may make
them less suitable for tasks requiring random access or when memory optimization is
crucial. Despite these trade-offs, linked lists serve as the foundation for many advanced
data structures like stacks, queues, and graphs, highlighting their importance in
computer science and programming.
In summary, linked lists are a powerful tool for managing collections of data,
particularly in scenarios requiring frequent modifications or dynamic sizing.

You might also like