0% found this document useful (0 votes)
9 views12 pages

Debjit Bhattacharya - Data Structure & Algorithms (ES-CS301) - CA1

The document discusses the benefits of linked lists over other data structures such as arrays and stacks, highlighting their dynamic size, efficient insertion and deletion operations, and flexible memory allocation. It compares linked lists with arrays and array lists, emphasizing their advantages in scenarios requiring frequent updates and unpredictable data sizes. The conclusion reinforces that while linked lists may have slower random access, their overall benefits make them a valuable data structure for specific applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views12 pages

Debjit Bhattacharya - Data Structure & Algorithms (ES-CS301) - CA1

The document discusses the benefits of linked lists over other data structures such as arrays and stacks, highlighting their dynamic size, efficient insertion and deletion operations, and flexible memory allocation. It compares linked lists with arrays and array lists, emphasizing their advantages in scenarios requiring frequent updates and unpredictable data sizes. The conclusion reinforces that while linked lists may have slower random access, their overall benefits make them a valuable data structure for specific applications.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

1

KALYANI GOVERNMENT
ENGINEERING COLLEGE

Benefits of
Linked List Over Other Data structures
Submitted by

Name: DEBJIT BHATTACHARYA

Department: ELECTRONICS AND COMMUNICATION EBGINEERING


Semester: 3rd
Roll Number:10200324072
< Department of Computer Science and Engineering >

KALYANI GOVERNMENT ENGINEERING COLLEGE,


KALYANI, NADIA-741235,WEST BENGAL, INDIA
2
ACKNOWLEDGEMENT

I would like to express my special thanks of gratitude to my teacher Prof Mr.


Arun Kumar Sadhu Sir as well as our principal Dr. Sourabh Kumar Das Sir who
gave me the golden opportunity to do this wonderful project on the topic of
“Benefits Of Linked List over other Data Structures” which also helped me in
doing a lot of research and I came to know about so many new things I am really
thankful to them. Secondly, I would also like to thank my parents and friends
who helped me a lot in finalizing this project within the limited time frame.
3
CONTENT

TOPIC PAGE NO.

• INTRODUCTION 4
• WHAT IS LINKED LIST ? 5
6
• LINKED LIST VS ARRAY
7
• LINKED LIST VS ARRAY LIST
• STACK (LINKED LIST – BASED) VS 8
STACK (ARRAY-BASED)

• QUEUE (LINKED LIST – BASED) VS 9

QUEUE (ARRAY-BASED)
11
• CONCLUSION
• REFERENCE 12
4

INTRODUCTION

When it comes to choosing the right data structure for a specific application,
understanding the strengths and weaknesses of each option is crucial. Linked
Lists, a fundamental data structure in computer science, offer several
advantages over other data structures like arrays and stacks. Unlike arrays,
which require contiguous memory and have a fixed size, Linked Lists are dynamic
and can easily grow or shrink in size. This flexibility makes them ideal for
scenarios where the size of the data set is unpredictable. Additionally, Linked
Lists provide efficient insertion and deletion operations, particularly when
compared to arrays, where shifting elements can be costly. This feature is
particularly useful in applications where frequent updates to the data
structure are necessary. Overall, the benefits of Linked Lists, including
dynamic memory allocation, efficient insertions and deletions, and ease of
implementation for certain types of problems, make them a valuable tool in the
programmer’s arsenal.
5
WHAT IS LINKED LIST ?

A linked list is a linear data structure that consists of a


series of nodes connected by pointers. Each node
contains data and a pointer/reference to the next node in
the list. Unlike arrays, linked lists allow for efficient
insertion or removal of elements from any position in the
list, as the nodes are not stored contiguously in memory.

Characteristics of Linked Lists:

• Dynamic Size
• Efficient Insertion and Deletion
• Sequential Access
• Flexible Implementation
• Unordered Elements
• Pointer Overhead

Types of linked lists:


• Singly Linked List: Consists of nodes that have a reference only to the next node
in the list.
• Doubly Linked List: Each node has references to both the next and previous
nodes in the list.
• Circular Linked List: Similar to a singly linked list, but the last node’s reference
points to the first node, creating a circular structure.
6
LINKED LIST VS ARRAY

Feature Linked List Array


Size Flexibility Dynamic size, grows Fixed size, must be
or shrinks as needed defined at creation

Memory Utilization Allocates memory May have unused


as needed, no waste memory or require
resizing
Insertion/Deletion O(1) for O(n) for
Efficiency insertions/deletions insertions/deletions
if reference is due to shifting
known
Memory Overhead Higher due to Lower, only stores
storing pointers data
Contiguous Memory No, can be scattered Yes, requires
Requirement in memory contiguous memory

Data Structure Easier to implement Best for static data


Implementation stacks, queues, or where size is
graphs known
7
LINKED LIST VS ARRAY LIST
Feature Linked List Array List
Size Flexibility Dynamic, can grow or shrink easily Dynamic, but resizing may involve costly
reallocation
Memory Utilization Allocates memory node by node Pre-allocates memory, may waste space
if underutilized
Insertion/Deletion Efficiency O(1) for insertions/deletions at the beginning or O(n) for insertions/deletions due to
middle (if reference is known) shifting elements
Memory Overhead Higher, as each element requires extra memory Lower, memory is only used for storing
for pointers elements
Contiguous Memory Requirement No, elements can be scattered in memory Yes, requires contiguous memory
Use Case Better for scenarios with frequent Better for scenarios with frequent access
insertions/deletions and unpredictable size and fewer insertions/deletions
8
STACK (LINKED LIST – BASED) VS STACK (ARRAY-BASED)

Stack Stack
Feature
(Linked List-Based) (Array – Based)
Memory Dynamic grows as needed Fixed size needs Stack(Array- Based)
Allocation pre-allocation

Memory Higher due to additional Lower, only storing


Overhead pointers actual elements

Insertion/Dele O(1) if pointer to the node O(n) for


tion is available insertions/deletions
Efficiency due to shifting
elements
Stack(Linked List- Based)
Resizing No resizing needed, grows Requires resizing or
dynamically reallocation

Access Time O(n) for access by index O(1) for access by


index
Use Case Better for scenarios with Better for scenarios
frequent with frequent
insertions/deletions and access and fewer
unpredictable size insertions/deletions
QUEUE (LINKED LIST – BASED) VS QUEUE (ARRAY-BASED) 9

Feature Linked List Array List


Memory Dynamic grows as Fixed size needs pre-
Allocation needed allocation
Space Efficiency O(1) for both enqueue O(1) for enqueue and
and dequeue dequeue if array is circular;
O(n) if resizing or shifting QUEUE (ARRAY-BASED)
elements
Insertion/Deletion O(1) if pointer to the O(n) for insertions/deletions
Efficiency node is available due to shifting elements

Resizing No resizing needed; Requires resizing or


grows dynamically reallocation when full
Overflow No special handling Requires special handling
Handling needed for circular wrap-around
Performance on Better for scenarios Better for scenarios with
Circular Queues with frequent frequent access and fewer
insertions/deletions insertions/deletions
and unpredictable size QUEUE (LINKED LIST – BASED)
10

CONCLUSION

In conclusion, linked lists offer several advantages over other data structures like
arrays, particularly in scenarios where dynamic memory allocation, efficient
insertions, and deletions are critical. The primary benefit of linked lists is their
ability to dynamically allocate memory, allowing for flexible memory usage without
predefining the size, unlike arrays that require a fixed size. Additionally, linked lists
provide efficient insertion and deletion operations, especially at the beginning or in
the middle, as these operations only require adjusting pointers, without needing to
shift elements as in an array. However, the trade-off comes in terms of random
access, which is slower in linked lists compared to arrays. Despite this, linked lists
remain an essential tool in situations where memory efficiency, frequent insertions
or deletions, and dynamic size adjustments are more important than random access
speed
11
REFERENCE

• “Data Structures and Algorithms Made Easy” by Narsimha Karumanchi

• “Introduction to Algorithms” by Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest and Clifford

Stein.

• “Algorithms” by Robert Sedgewick and Kevin Wayne.

• Data Structures Through C In Depth by S. K. Srivastava, Deepali Srivastava


13

THANK YOU

You might also like