0% found this document useful (0 votes)
41 views8 pages

Array Vs Linked List

Uploaded by

Devi Mazumder
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)
41 views8 pages

Array Vs Linked List

Uploaded by

Devi Mazumder
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

INTRODUCTION

• A linear data structure is a linked list. Every linked list consists of two sections,
the data portion and the address section, which contains the address of the
node, the subsequent entry in the list.
• The linked list's size is flexible, and data items can be added to the list
anywhere.
• Arrays are the derived data type in C programming language which can store
the primitive type of data such as int, char, double, float, etc.
• Array also has the capability to store the collection of derived data types,
such as pointers, structure, etc.
LINKED LIST- DEFINITION
• A linked list is the most sought-after data structure when it comes to handling
dynamic data elements.
• A node is a type of data element found in linked lists. Additionally, each node
has two fields: one field contains data, and the other field contains an address
that maintains a link to the node after it.
• A linked list of data and a pointer that contains the address of the node after it
make up each node's two fields.
• A linked list can grow and shrink its size, as per the requirement.
• It does not waste memory space.
ARRAYS-DEFINITION
• An array is a group of related data elements kept in close proximity to one
another in memory. The sole way to retrieve each data element directly is by
using its index number, making it the most basic data structure.
• A variable that can hold numerous values is called an array. You could make
an array for it, for instance, if you wanted to store 100 integers.
• By using the index number, it is relatively simple to access an element in an
array. An array can readily be used in the search process. Matrix
representation is done using 2D arrays.
• When a user process requests memory, one of the portions of the contiguous
memory block is given to that process in accordance with its needs. This
memory management approach is known as contiguous memory allocation .
Arrays are stored in that contiguous memory allocation.
ADVANTAGES OF LINKED LIST
• Linked lists are dynamic data structures, which means they can expand or
contract as a program is running.
• A Linked list does not require the definition of an initial size.
• It is not necessary to state how many nodes are needed.
• The key benefit of a linked list is that inserting and deleting items is faster and
easier.
• We can easily carry out some complex application ,like-tack and Queue
Implementation, Adjacency List Implementation for Graphs, Abstract Data
Type Implementation, S-expressions
ADVANTAGES OF ARRAYS
• Any array element can be accessed at any time ("random access").
• Only a doubly linked list can be used to traverse an array from back to front; a
single linked list cannot.
• We can use pointer math on the array to access each element.
• An array can readily be used in the search process.
• Matrix representation is done using 2D arrays.
• Arrays can be used for CPU scheduling.
DISADVANTAGES OF LINKED LIST
• Linked lists are not fixed in size.
• Every time , element accessing requires the traversal of the whole linked list.
• More memory is needed as additional storage is required for pointers.
• Linked list takes slow search time.
• In case of linked list , random access is not possible.
DISADVANTAGES OF ARRAYS
• Arrays can not accommodate new values.
• In case of arrays , we can see the wastage of memory space if all the array
elements are not used.
• The insertion time or deletion time is very slow.
• Arrays have got fixed size.
• Arrays require large number of scan position.
THANK YOU

You might also like