0% found this document useful (0 votes)
10 views6 pages

Redundancy

A linked list is a data structure consisting of nodes that hold data and pointers to the next node, allowing for dynamic memory allocation and efficient insertion and deletion. There are two main types: singly linked lists, where each node points to the next, and doubly linked lists, which allow traversal in both directions. While linked lists offer advantages such as flexible size and efficient memory usage, they also have drawbacks like increased space requirements and slower traversal times compared to arrays.

Uploaded by

lavanya desai
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)
10 views6 pages

Redundancy

A linked list is a data structure consisting of nodes that hold data and pointers to the next node, allowing for dynamic memory allocation and efficient insertion and deletion. There are two main types: singly linked lists, where each node points to the next, and doubly linked lists, which allow traversal in both directions. While linked lists offer advantages such as flexible size and efficient memory usage, they also have drawbacks like increased space requirements and slower traversal times compared to arrays.

Uploaded by

lavanya desai
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/ 6

WHAT IS A LINKED LIST?

A linked list is a sequence of nodes, each holding data and a pointer to the next node in the
list. The nodes are stored randomly in the primary memory space and are not necessarily
contiguous. This is the main benefit of the Linked List, as it helps in better memory
management. The data section stores the actual value/data. The next section stores the
address of the next node.
• Dynamic Allocation
Nodes are allocated dynamically, allowing the list to grow or shrink during execution.
• Linear Structure
Elements are arranged sequentially, similar to an array, but with more flexibility.
• Pointer-Based
Nodes are linked through pointers, enabling efficient insertion and deletion.
SINGLY LINKED LIST
In a singly linked list, each node points to the next node in the sequence.
 Head
The first node in the list.
 Node
Contains data and a pointer to the next node.
 Tail
The last node in the list, with a NULL pointer.
DOUBLY LINKED LIST

Doubly linked lists allow traversal in both directions, as each node has pointers to
both the previous and next nodes.
• Previous Pointer
Points to the node before the current node.
• Next Pointer
Points to the node after the current node.
• Data
Stores the actual value or information associated with the node.
OPERATIONS ON LINKED LIST

There are various linked list operations that allow us to perform different actions on linked
lists. For example, the insertion operation adds a new element to the linked list.
 Traversal - access each element of the linked list
 Insertion - adds a new element to the linked list
 Deletion - removes the existing elements
 Search - find a node in the linked list
 Sort - sort the nodes of the linked list
ADVANTAGES OF LINKED LIST

• Linked List provides the facility to insert and remove nodes dynamically. Users can increase and decrease the size
of a linked list by inserting a node either in the last or in the starting, or in between the linked List and by deleting
a node, respectively, according to their requirements.
• Linked List follows an efficient memory allocation of node (data). In the linked list format of storing the data, the
nodes are not stored in a contiguous way like in an array; rather, nodes are stored at random memory locations.
This reduces memory wastage. We need not predefine the size of the linked List.
• Linked List provides an easy way the implementation of various data structures like a queue, graph, and stack.
• The operations of deletion and insertion are very optimal in the case of Linked List. Unlike in an array, we need not
shift or change the positions of an existing node, and we can insert and delete a node in between the linked List at
any position. Shifting of elements/nodes is a very time-consuming process.
• The best advantage of Linked List comes into action while dealing with a huge amount of data and when data is
non-static. i.e., changes with time; as storage of Linked List nodes does not take place in a regular/continuous
manner, we can store any node anywhere.
DISADVANTAGES OF LINKED LIST

• In the linked List, two sections of a single node are the data storing part and the next part to store the address
of another node. So, to store even a single node, we need more space than storing an element in the array.
• To reach a particular node, we need to traverse the nodes present before it; hence traversing in the linked List
is a time taking process. For example, in the given linked List, if we intend to access ten, then there is no
direct way to 12, and we need to visit all nodes before 12, i.e., 2,4,6,8, and then we can reach 12.
• We cannot directly access a specific node in the Linked List because of the absence of an index approach.
• Traversing in reverse order is not possible in a singly linked list, but it is possible in a doubly linked list since
the previous pointer is present to traverse backward.
• Using a linked List as a data structure is not suggestible for storing and sharing a small amount of data.
• Understanding the overall implementation of the Linked List is not easy as it includes the concepts of classes,
constructors, objects, and even struct. A novice cannot directly go with a linked List without understanding
these concepts.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy