SlideShare a Scribd company logo
DATA STRUCTURE
BY : M O H A M M E D E L S D O D Y
LINKED LIST INTRODUCTION
• Like arrays, Linked List is a linear data structure. Unlike arrays, linked list elements are
not stored at a contiguous location; the elements are linked using pointers.
WHY LINKED LIST?
• Why Linked List?
Arrays can be used to store linear data of similar types, but arrays have the following limitations.
1) The size of the arrays is fixed: So we must know the upper limit on the number of elements in advance.
Also, generally, the allocated memory is equal to the upper limit irrespective of the usage.
2) Inserting a new element in an array of elements is expensive because the room has to be created for
the new elements and to create room existing elements have to be shifted.
• For example, in a system, if we maintain a sorted list of IDs in an array id[].
• id[] = [1000, 1010, 1050, 2000, 2040].
• And if we want to insert a new ID 1005, then to maintain the sorted order, we have to move all the
after 1000 (excluding 1000).
Deletion is also expensive with arrays until unless some special techniques are used. For example, to delete
1010 in id[], everything after 1010 has to be moved.
• Advantages over arrays
1) Dynamic size
2) Ease of insertion/deletion
WHY LINKED LIST?
• Drawbacks:
1) Random access is not allowed. We have to access elements sequentially starting from the first
node. So we cannot do binary search with linked lists efficiently with its default implementation.
about it here.
2) Extra memory space for a pointer is required with each element of the list.
3) Not cache friendly. Since array elements are contiguous locations, there is locality of reference
which is not there in case of linked lists.
• Representation:
A linked list is represented by a pointer to the first node of the linked list. The first node is called the
head. If the linked list is empty, then the value of the head is NULL.
Each node in a list consists of at least two parts:
1) data
2) Pointer (Or Reference) to the next node
In C, we can represent a node using structures. Below is an example of a linked list node with integer
data.
In Java or C#, LinkedList can be represented as a class and a Node as a separate class. The
class contains a reference of Node class type.
REPRESENTATION
REPRESENTATION
REPRESENTATION

More Related Content

PPTX
Linked stacks and queues
DOCX
Data structures notes
PDF
Java Linked List Tutorial | Edureka
PPTX
What is Link list? explained with animations
PPTX
Linked list
PPTX
Ml study notes linq
PPTX
Linked list
PPTX
linked list in Data Structure, Simple and Easy Tutorial
Linked stacks and queues
Data structures notes
Java Linked List Tutorial | Edureka
What is Link list? explained with animations
Linked list
Ml study notes linq
Linked list
linked list in Data Structure, Simple and Easy Tutorial

What's hot (20)

PPTX
Insertion in singly linked list
PPTX
Introduction to data structure
PPTX
Data structures Lecture no.3
PPTX
Data structures Lecture no. 2
PPTX
Data structures lectures no 1
PPTX
1.introduction to data_structures
PPTX
Presentation on Data Structure
PPTX
Linked list in Data Structure and Algorithm
PPT
Introduction to data structure
PPT
Introductiont To Aray,Tree,Stack, Queue
PPT
Abstract data types (adt) intro to data structure part 2
PPTX
Introduction of Data Structure
PPT
Lecture7
PPTX
Linked list
PPT
Two Dimensional Array
PPTX
data structures and algorithms Unit 1
PPTX
Data structure & its types
PPT
Doubly linked list
PPT
Data Structure and Algorithms Linked List
PPTX
Data structure power point presentation
Insertion in singly linked list
Introduction to data structure
Data structures Lecture no.3
Data structures Lecture no. 2
Data structures lectures no 1
1.introduction to data_structures
Presentation on Data Structure
Linked list in Data Structure and Algorithm
Introduction to data structure
Introductiont To Aray,Tree,Stack, Queue
Abstract data types (adt) intro to data structure part 2
Introduction of Data Structure
Lecture7
Linked list
Two Dimensional Array
data structures and algorithms Unit 1
Data structure & its types
Doubly linked list
Data Structure and Algorithms Linked List
Data structure power point presentation
Ad

Similar to Data structure day1 (20)

DOCX
Linked List
PPTX
Introduction to Data Structures and Linked List
PPTX
Linked lists linked lists vs Arrays.pptx
PPTX
Linked Lists in Data Structures ppt .pptx
PDF
DS Module 03.pdf
PPTX
Link list
PPTX
Link list
PDF
Linked list (introduction) 1
PPTX
UNIT 2LINKEDLISdddddddddddddddddddddddddddT.pptx
PPTX
RPT_03_A_Linked List presentation for FE
PPTX
Linked lists
PPTX
Linked list
PPTX
Data Structures-UNIT Four_Linked_List.pptx
PPT
Lecture 3 List of Data Structures & Algorithms
PPTX
linkedlistforslideshare-210123143943.pptx
PPTX
DS_LinkedList.pptx
PPTX
module 3-.pptx
PPT
LINKEDb2bb22bb3b3b3b3n3_LIST_UKL_1-2.ppt
PPT
Lecture 2b lists
PDF
Data Structures and Algorithms-DSA_Linkedlist_class 1.pdf
Linked List
Introduction to Data Structures and Linked List
Linked lists linked lists vs Arrays.pptx
Linked Lists in Data Structures ppt .pptx
DS Module 03.pdf
Link list
Link list
Linked list (introduction) 1
UNIT 2LINKEDLISdddddddddddddddddddddddddddT.pptx
RPT_03_A_Linked List presentation for FE
Linked lists
Linked list
Data Structures-UNIT Four_Linked_List.pptx
Lecture 3 List of Data Structures & Algorithms
linkedlistforslideshare-210123143943.pptx
DS_LinkedList.pptx
module 3-.pptx
LINKEDb2bb22bb3b3b3b3n3_LIST_UKL_1-2.ppt
Lecture 2b lists
Data Structures and Algorithms-DSA_Linkedlist_class 1.pdf
Ad

More from Mohammed Elsdody (6)

PPTX
Data structure day7
PPTX
Data structure day 6
PPTX
Data structure day5
PPTX
Data structure day4
PPTX
Data structure day3
PPTX
Data structure day 2
Data structure day7
Data structure day 6
Data structure day5
Data structure day4
Data structure day3
Data structure day 2

Recently uploaded (20)

PPTX
Computer Software and OS of computer science of grade 11.pptx
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PDF
Nekopoi APK 2025 free lastest update
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
assetexplorer- product-overview - presentation
PPTX
ai tools demonstartion for schools and inter college
PDF
Understanding Forklifts - TECH EHS Solution
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPT
Introduction Database Management System for Course Database
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
PTS Company Brochure 2025 (1).pdf.......
Computer Software and OS of computer science of grade 11.pptx
2025 Textile ERP Trends: SAP, Odoo & Oracle
Nekopoi APK 2025 free lastest update
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
L1 - Introduction to python Backend.pptx
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
assetexplorer- product-overview - presentation
ai tools demonstartion for schools and inter college
Understanding Forklifts - TECH EHS Solution
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Softaken Excel to vCard Converter Software.pdf
Which alternative to Crystal Reports is best for small or large businesses.pdf
How to Migrate SBCGlobal Email to Yahoo Easily
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Odoo Companies in India – Driving Business Transformation.pdf
Introduction Database Management System for Course Database
VVF-Customer-Presentation2025-Ver1.9.pptx
CHAPTER 2 - PM Management and IT Context
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PTS Company Brochure 2025 (1).pdf.......

Data structure day1

  • 1. DATA STRUCTURE BY : M O H A M M E D E L S D O D Y
  • 2. LINKED LIST INTRODUCTION • Like arrays, Linked List is a linear data structure. Unlike arrays, linked list elements are not stored at a contiguous location; the elements are linked using pointers.
  • 3. WHY LINKED LIST? • Why Linked List? Arrays can be used to store linear data of similar types, but arrays have the following limitations. 1) The size of the arrays is fixed: So we must know the upper limit on the number of elements in advance. Also, generally, the allocated memory is equal to the upper limit irrespective of the usage. 2) Inserting a new element in an array of elements is expensive because the room has to be created for the new elements and to create room existing elements have to be shifted. • For example, in a system, if we maintain a sorted list of IDs in an array id[]. • id[] = [1000, 1010, 1050, 2000, 2040]. • And if we want to insert a new ID 1005, then to maintain the sorted order, we have to move all the after 1000 (excluding 1000). Deletion is also expensive with arrays until unless some special techniques are used. For example, to delete 1010 in id[], everything after 1010 has to be moved. • Advantages over arrays 1) Dynamic size 2) Ease of insertion/deletion
  • 4. WHY LINKED LIST? • Drawbacks: 1) Random access is not allowed. We have to access elements sequentially starting from the first node. So we cannot do binary search with linked lists efficiently with its default implementation. about it here. 2) Extra memory space for a pointer is required with each element of the list. 3) Not cache friendly. Since array elements are contiguous locations, there is locality of reference which is not there in case of linked lists. • Representation: A linked list is represented by a pointer to the first node of the linked list. The first node is called the head. If the linked list is empty, then the value of the head is NULL. Each node in a list consists of at least two parts: 1) data 2) Pointer (Or Reference) to the next node In C, we can represent a node using structures. Below is an example of a linked list node with integer data. In Java or C#, LinkedList can be represented as a class and a Node as a separate class. The class contains a reference of Node class type.