SlideShare a Scribd company logo
Linked list using Dynamic Memory Allocation
Linked list
• A linked list is a data structure which is a sequence of nodes in
which each node is linked, or connected to, the node following it.
Each node element is called node.
In this figure store two thing :-
 An element of the list.
 A link or address of the other node.
Type of Linked List
There are 4 type of linked list such as:-
• Singly-linked list
• Doubly linked list
• Circular linked list
• Circular doubly linked list.
Operation of linked list
There are some operation to be performed on the
liked lists are as follows:-
• Creation
• Insertion
• Deletion
• traversing
• Searching
• concatenation
• Display.
Singly linked list
• A singly linked list is dynamic data structure. It may grow or shrink. Growing or shrinking
depends on the operations made.
• In ‘c’ a linked list is created using structure , pointer and dynamic memory allocation
function malloc(). We consider head as external pointer.
Creating a node:-
struct node {
Int data;
Node*next;
}
start;
Start=NULL;
Implementation of Linked List.
• Insertion of a node at the beginning
• Insertion of a node at the end
• Insertion of a node after a specified node
• Deletion of a particular node from the list
• Traversing of entire link list.
Inserting a node at beginning
• Algorithm:-
1) Insert_first(Start, item)
[Check the overflow]
if ptr=NULL, then
Print “overflow
Exit
else
Ptr=(node*)malloc(size of node));
End if
2) Set ptr->Info=item
3) Set ptr->next=start
4) Set start=ptr
Inserting a node at the end
Insert _last(Start , item)
1) [check over flow?]
if ptr=NULL, then
print ”over flow”
exit
else
ptr=(node*)malloc(sizeOf(node));
end if
2) Set ptr->info=item
3) Set ptr->next=NULL
4) If start=NULL and if then set start=p;
5) loc=start
6) Repeate step 7 until loc->next!=NULL
7) Loc=loc->next
8) Loc->next=p
Insertion at the specified position
C code:-
void insert_spe(int item, int loc){
NODE *p,*temp;
int k;
for(k=0;temp=start;k<loc;k++)
{
temp=temp->next;
If(temp==NULL){
printf(“node in the list at less than onen”);
return;
}
}
p=(NODE*)malloc(sizeof(NODE));
p->info=item;
p->next=loc->next;
loc->next=p;
}
Doubly Linked list
• In double linked list, every node has link to its previous
node and next node.
we can traverse forward by using next field and can traverse
backward by using previous field. Every node in a double
linked list contains three fields and they are shown in the
following figure...
Doubly Linked list…continue..
Structure definition Doubly linked list:-
struct node
{
int num;
struct node*prev;
struct node*node;
};
typedef struct node NODE;
Circular linked list
• Circular linked list is a sequence of elements in which every
element has link to its next element in the sequence and the
last element has a link to the first element in the sequence.
• There is no NULL at the end.
• A circular linked list can be a singly circular linked list or
doubly circular linked list.
Circular linked list… continue..
• The structure definition of the circular linked.:-
struct node
{
int info;
struct node *next;
};
typedef struct node *NODEPTR;
Circular Doubly Linked list
• Circular Doubly Linked List has properties of both doubly
linked list and circular linked list
• In which two consecutive elements are linked or connected
by previous and next pointer.
• And the last node points to first node by next pointer and also
the first node points to last node by previous pointer
Circular doubly linked list….. Conti..
•
typedef struct _dslist_node 3
{
int node_value; /* Data value */
struct _dslist_node * prev; /* pointer to previous node
*/
struct _dslist_node * next; /* pointer to next node */
}
dslist_node;
Advantages
• List can be traversed bothways from head to tail as well as tail
to head
• Being a circular linked list tail can be reached with one
operation from head node
Disadvantages
• It takes slightly extra memory in each node to accomodate
previous pointer
Practical Applications
• Managing songs playlist in media player applications
• Managing shopping cart in online shopping
Linked list using Dynamic Memory Allocation
Ad

More Related Content

What's hot (20)

Presentation on queue
Presentation on queuePresentation on queue
Presentation on queue
Rojan Pariyar
 
Stack organization
Stack organizationStack organization
Stack organization
chauhankapil
 
Terminology of tree
Terminology of treeTerminology of tree
Terminology of tree
RacksaviR
 
Data structure , stack , queue
Data structure , stack , queueData structure , stack , queue
Data structure , stack , queue
Rajkiran Nadar
 
Binary search tree(bst)
Binary search tree(bst)Binary search tree(bst)
Binary search tree(bst)
Hossain Md Shakhawat
 
PHP Variables and scopes
PHP Variables and scopesPHP Variables and scopes
PHP Variables and scopes
sana mateen
 
Input output interface
Input output interfaceInput output interface
Input output interface
Christ University
 
Applications of stack
Applications of stackApplications of stack
Applications of stack
eShikshak
 
header, circular and two way linked lists
header, circular and two way linked listsheader, circular and two way linked lists
header, circular and two way linked lists
student
 
Stacks in c++
Stacks in c++Stacks in c++
Stacks in c++
Vineeta Garg
 
Microprocessor
MicroprocessorMicroprocessor
Microprocessor
aaina_katyal
 
Data Structure and Algorithms Linked List
Data Structure and Algorithms Linked ListData Structure and Algorithms Linked List
Data Structure and Algorithms Linked List
ManishPrajapati78
 
Cache memory
Cache memoryCache memory
Cache memory
Anuj Modi
 
1.7 avl tree
1.7 avl tree 1.7 avl tree
1.7 avl tree
Krish_ver2
 
DBMS and its Models
DBMS and its ModelsDBMS and its Models
DBMS and its Models
AhmadShah Sultani
 
data structures and its importance
 data structures and its importance  data structures and its importance
data structures and its importance
Anaya Zafar
 
Block diagram of computer 02
Block diagram of computer 02Block diagram of computer 02
Block diagram of computer 02
ZTE Nepal
 
Elementary data organisation
Elementary data organisationElementary data organisation
Elementary data organisation
Muzamil Hussain
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data Structure
Anuj Modi
 
Linked list
Linked listLinked list
Linked list
akshat360
 
Presentation on queue
Presentation on queuePresentation on queue
Presentation on queue
Rojan Pariyar
 
Stack organization
Stack organizationStack organization
Stack organization
chauhankapil
 
Terminology of tree
Terminology of treeTerminology of tree
Terminology of tree
RacksaviR
 
Data structure , stack , queue
Data structure , stack , queueData structure , stack , queue
Data structure , stack , queue
Rajkiran Nadar
 
PHP Variables and scopes
PHP Variables and scopesPHP Variables and scopes
PHP Variables and scopes
sana mateen
 
Applications of stack
Applications of stackApplications of stack
Applications of stack
eShikshak
 
header, circular and two way linked lists
header, circular and two way linked listsheader, circular and two way linked lists
header, circular and two way linked lists
student
 
Data Structure and Algorithms Linked List
Data Structure and Algorithms Linked ListData Structure and Algorithms Linked List
Data Structure and Algorithms Linked List
ManishPrajapati78
 
Cache memory
Cache memoryCache memory
Cache memory
Anuj Modi
 
data structures and its importance
 data structures and its importance  data structures and its importance
data structures and its importance
Anaya Zafar
 
Block diagram of computer 02
Block diagram of computer 02Block diagram of computer 02
Block diagram of computer 02
ZTE Nepal
 
Elementary data organisation
Elementary data organisationElementary data organisation
Elementary data organisation
Muzamil Hussain
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data Structure
Anuj Modi
 

Similar to Linked list using Dynamic Memory Allocation (20)

Unit 5 linked list
Unit   5 linked listUnit   5 linked list
Unit 5 linked list
Dabbal Singh Mahara
 
Doubly & Circular Linked Lists
Doubly & Circular Linked ListsDoubly & Circular Linked Lists
Doubly & Circular Linked Lists
Afaq Mansoor Khan
 
Deleting a node from the list(SINGLE LINKED LIST)
Deleting a node from the list(SINGLE LINKED LIST)Deleting a node from the list(SINGLE LINKED LIST)
Deleting a node from the list(SINGLE LINKED LIST)
JayasankarShyam
 
Linked Lists, Single Linked list and its operations
Linked Lists, Single Linked list and its operationsLinked Lists, Single Linked list and its operations
Linked Lists, Single Linked list and its operations
BackiyalakshmiVenkat
 
Unit II Data Structure 2hr topic - List - Operations.pptx
Unit II  Data Structure 2hr topic - List - Operations.pptxUnit II  Data Structure 2hr topic - List - Operations.pptx
Unit II Data Structure 2hr topic - List - Operations.pptx
Mani .S (Specialization in Semantic Web)
 
DS Module 03.pdf
DS Module 03.pdfDS Module 03.pdf
DS Module 03.pdf
SonaPathak5
 
UNIT 2LINKEDLISdddddddddddddddddddddddddddT.pptx
UNIT 2LINKEDLISdddddddddddddddddddddddddddT.pptxUNIT 2LINKEDLISdddddddddddddddddddddddddddT.pptx
UNIT 2LINKEDLISdddddddddddddddddddddddddddT.pptx
shesnasuneer
 
Singly linked list
Singly linked listSingly linked list
Singly linked list
Amar Jukuntla
 
Data Structure Lecture 3 Linked Lists.pdf
Data Structure Lecture 3 Linked Lists.pdfData Structure Lecture 3 Linked Lists.pdf
Data Structure Lecture 3 Linked Lists.pdf
donotreply20
 
DS Unit 2.ppt
DS Unit 2.pptDS Unit 2.ppt
DS Unit 2.ppt
JITTAYASHWANTHREDDY
 
linked list2.ppt linked list part 2 ppt
linked list2.ppt linked list part 2  pptlinked list2.ppt linked list part 2  ppt
linked list2.ppt linked list part 2 ppt
nisharaheja1986
 
Linked list
Linked listLinked list
Linked list
KalaivaniKS1
 
ANOITO2341988888888888888888888885555.ppt
ANOITO2341988888888888888888888885555.pptANOITO2341988888888888888888888885555.ppt
ANOITO2341988888888888888888888885555.ppt
robertobula2
 
DSModule2.pptx
DSModule2.pptxDSModule2.pptx
DSModule2.pptx
ChrisSosaJacob
 
Data Structures_Linked List
Data Structures_Linked ListData Structures_Linked List
Data Structures_Linked List
ThenmozhiK5
 
DS_LinkedList.pptx
DS_LinkedList.pptxDS_LinkedList.pptx
DS_LinkedList.pptx
msohail37
 
linkedlistforslideshare-210123143943.pptx
linkedlistforslideshare-210123143943.pptxlinkedlistforslideshare-210123143943.pptx
linkedlistforslideshare-210123143943.pptx
shesnasuneer
 
Team 10
Team 10Team 10
Team 10
Sathasivam Rangasamy
 
Linked List
Linked ListLinked List
Linked List
RaaviKapoor
 
5.Linked list
5.Linked list 5.Linked list
5.Linked list
Mandeep Singh
 
Doubly & Circular Linked Lists
Doubly & Circular Linked ListsDoubly & Circular Linked Lists
Doubly & Circular Linked Lists
Afaq Mansoor Khan
 
Deleting a node from the list(SINGLE LINKED LIST)
Deleting a node from the list(SINGLE LINKED LIST)Deleting a node from the list(SINGLE LINKED LIST)
Deleting a node from the list(SINGLE LINKED LIST)
JayasankarShyam
 
Linked Lists, Single Linked list and its operations
Linked Lists, Single Linked list and its operationsLinked Lists, Single Linked list and its operations
Linked Lists, Single Linked list and its operations
BackiyalakshmiVenkat
 
DS Module 03.pdf
DS Module 03.pdfDS Module 03.pdf
DS Module 03.pdf
SonaPathak5
 
UNIT 2LINKEDLISdddddddddddddddddddddddddddT.pptx
UNIT 2LINKEDLISdddddddddddddddddddddddddddT.pptxUNIT 2LINKEDLISdddddddddddddddddddddddddddT.pptx
UNIT 2LINKEDLISdddddddddddddddddddddddddddT.pptx
shesnasuneer
 
Data Structure Lecture 3 Linked Lists.pdf
Data Structure Lecture 3 Linked Lists.pdfData Structure Lecture 3 Linked Lists.pdf
Data Structure Lecture 3 Linked Lists.pdf
donotreply20
 
linked list2.ppt linked list part 2 ppt
linked list2.ppt linked list part 2  pptlinked list2.ppt linked list part 2  ppt
linked list2.ppt linked list part 2 ppt
nisharaheja1986
 
ANOITO2341988888888888888888888885555.ppt
ANOITO2341988888888888888888888885555.pptANOITO2341988888888888888888888885555.ppt
ANOITO2341988888888888888888888885555.ppt
robertobula2
 
Data Structures_Linked List
Data Structures_Linked ListData Structures_Linked List
Data Structures_Linked List
ThenmozhiK5
 
DS_LinkedList.pptx
DS_LinkedList.pptxDS_LinkedList.pptx
DS_LinkedList.pptx
msohail37
 
linkedlistforslideshare-210123143943.pptx
linkedlistforslideshare-210123143943.pptxlinkedlistforslideshare-210123143943.pptx
linkedlistforslideshare-210123143943.pptx
shesnasuneer
 
Ad

More from kiran Patel (11)

2017 Union budget of India
2017 Union budget of India 2017 Union budget of India
2017 Union budget of India
kiran Patel
 
C++ concept of Polymorphism
C++ concept of  PolymorphismC++ concept of  Polymorphism
C++ concept of Polymorphism
kiran Patel
 
Database Management System( Normalization)
Database Management System( Normalization)Database Management System( Normalization)
Database Management System( Normalization)
kiran Patel
 
B tree (computer Science)
B tree (computer Science)B tree (computer Science)
B tree (computer Science)
kiran Patel
 
Effort estimation( software Engineering)
Effort estimation( software Engineering)Effort estimation( software Engineering)
Effort estimation( software Engineering)
kiran Patel
 
Thread (Operating System)
Thread  (Operating System)Thread  (Operating System)
Thread (Operating System)
kiran Patel
 
Library management (use case diagram Software engineering)
Library management (use case  diagram Software engineering)Library management (use case  diagram Software engineering)
Library management (use case diagram Software engineering)
kiran Patel
 
Brain Computer Interface
Brain Computer InterfaceBrain Computer Interface
Brain Computer Interface
kiran Patel
 
Artificial Inteligence
Artificial InteligenceArtificial Inteligence
Artificial Inteligence
kiran Patel
 
Smart buckets ppt
Smart buckets pptSmart buckets ppt
Smart buckets ppt
kiran Patel
 
Dynamic memory Allocation in c language
Dynamic memory Allocation in c languageDynamic memory Allocation in c language
Dynamic memory Allocation in c language
kiran Patel
 
2017 Union budget of India
2017 Union budget of India 2017 Union budget of India
2017 Union budget of India
kiran Patel
 
C++ concept of Polymorphism
C++ concept of  PolymorphismC++ concept of  Polymorphism
C++ concept of Polymorphism
kiran Patel
 
Database Management System( Normalization)
Database Management System( Normalization)Database Management System( Normalization)
Database Management System( Normalization)
kiran Patel
 
B tree (computer Science)
B tree (computer Science)B tree (computer Science)
B tree (computer Science)
kiran Patel
 
Effort estimation( software Engineering)
Effort estimation( software Engineering)Effort estimation( software Engineering)
Effort estimation( software Engineering)
kiran Patel
 
Thread (Operating System)
Thread  (Operating System)Thread  (Operating System)
Thread (Operating System)
kiran Patel
 
Library management (use case diagram Software engineering)
Library management (use case  diagram Software engineering)Library management (use case  diagram Software engineering)
Library management (use case diagram Software engineering)
kiran Patel
 
Brain Computer Interface
Brain Computer InterfaceBrain Computer Interface
Brain Computer Interface
kiran Patel
 
Artificial Inteligence
Artificial InteligenceArtificial Inteligence
Artificial Inteligence
kiran Patel
 
Smart buckets ppt
Smart buckets pptSmart buckets ppt
Smart buckets ppt
kiran Patel
 
Dynamic memory Allocation in c language
Dynamic memory Allocation in c languageDynamic memory Allocation in c language
Dynamic memory Allocation in c language
kiran Patel
 
Ad

Recently uploaded (20)

What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?
HireME
 
Building Apps for Good The Ethics of App Development
Building Apps for Good The Ethics of App DevelopmentBuilding Apps for Good The Ethics of App Development
Building Apps for Good The Ethics of App Development
Net-Craft.com
 
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdfTop Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
evrigsolution
 
Adobe InDesign Crack FREE Download 2025 link
Adobe InDesign Crack FREE Download 2025 linkAdobe InDesign Crack FREE Download 2025 link
Adobe InDesign Crack FREE Download 2025 link
mahmadzubair09
 
AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?
Amara Nielson
 
How to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryErrorHow to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryError
Tier1 app
 
Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025
Phil Eaton
 
How I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetryHow I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetry
Cees Bos
 
Microsoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptxMicrosoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptx
Mekonnen
 
Wilcom Embroidery Studio Crack 2025 For Windows
Wilcom Embroidery Studio Crack 2025 For WindowsWilcom Embroidery Studio Crack 2025 For Windows
Wilcom Embroidery Studio Crack 2025 For Windows
Google
 
Exchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv SoftwareExchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv Software
Shoviv Software
 
Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025
GrapesTech Solutions
 
Download MathType Crack Version 2025???
Download MathType Crack  Version 2025???Download MathType Crack  Version 2025???
Download MathType Crack Version 2025???
Google
 
Medical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk ScoringMedical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk Scoring
ICS
 
Innovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at allInnovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at all
ayeshakanwal75
 
Adobe Media Encoder Crack FREE Download 2025
Adobe Media Encoder  Crack FREE Download 2025Adobe Media Encoder  Crack FREE Download 2025
Adobe Media Encoder Crack FREE Download 2025
zafranwaqar90
 
Sequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptxSequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptx
aashrithakondapalli8
 
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
Ranking Google
 
Digital Twins Software Service in Belfast
Digital Twins Software Service in BelfastDigital Twins Software Service in Belfast
Digital Twins Software Service in Belfast
julia smits
 
Robotic Process Automation (RPA) Software Development Services.pptx
Robotic Process Automation (RPA) Software Development Services.pptxRobotic Process Automation (RPA) Software Development Services.pptx
Robotic Process Automation (RPA) Software Development Services.pptx
julia smits
 
What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?What Do Candidates Really Think About AI-Powered Recruitment Tools?
What Do Candidates Really Think About AI-Powered Recruitment Tools?
HireME
 
Building Apps for Good The Ethics of App Development
Building Apps for Good The Ethics of App DevelopmentBuilding Apps for Good The Ethics of App Development
Building Apps for Good The Ethics of App Development
Net-Craft.com
 
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdfTop Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
Top Magento Hyvä Theme Features That Make It Ideal for E-commerce.pdf
evrigsolution
 
Adobe InDesign Crack FREE Download 2025 link
Adobe InDesign Crack FREE Download 2025 linkAdobe InDesign Crack FREE Download 2025 link
Adobe InDesign Crack FREE Download 2025 link
mahmadzubair09
 
AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?AI in Business Software: Smarter Systems or Hidden Risks?
AI in Business Software: Smarter Systems or Hidden Risks?
Amara Nielson
 
How to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryErrorHow to Troubleshoot 9 Types of OutOfMemoryError
How to Troubleshoot 9 Types of OutOfMemoryError
Tier1 app
 
Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025Memory Management and Leaks in Postgres from pgext.day 2025
Memory Management and Leaks in Postgres from pgext.day 2025
Phil Eaton
 
How I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetryHow I solved production issues with OpenTelemetry
How I solved production issues with OpenTelemetry
Cees Bos
 
Microsoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptxMicrosoft Excel Core Points Training.pptx
Microsoft Excel Core Points Training.pptx
Mekonnen
 
Wilcom Embroidery Studio Crack 2025 For Windows
Wilcom Embroidery Studio Crack 2025 For WindowsWilcom Embroidery Studio Crack 2025 For Windows
Wilcom Embroidery Studio Crack 2025 For Windows
Google
 
Exchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv SoftwareExchange Migration Tool- Shoviv Software
Exchange Migration Tool- Shoviv Software
Shoviv Software
 
Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025Top 12 Most Useful AngularJS Development Tools to Use in 2025
Top 12 Most Useful AngularJS Development Tools to Use in 2025
GrapesTech Solutions
 
Download MathType Crack Version 2025???
Download MathType Crack  Version 2025???Download MathType Crack  Version 2025???
Download MathType Crack Version 2025???
Google
 
Medical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk ScoringMedical Device Cybersecurity Threat & Risk Scoring
Medical Device Cybersecurity Threat & Risk Scoring
ICS
 
Innovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at allInnovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at all
ayeshakanwal75
 
Adobe Media Encoder Crack FREE Download 2025
Adobe Media Encoder  Crack FREE Download 2025Adobe Media Encoder  Crack FREE Download 2025
Adobe Media Encoder Crack FREE Download 2025
zafranwaqar90
 
Sequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptxSequence Diagrams With Pictures (1).pptx
Sequence Diagrams With Pictures (1).pptx
aashrithakondapalli8
 
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
!%& IDM Crack with Internet Download Manager 6.42 Build 32 >
Ranking Google
 
Digital Twins Software Service in Belfast
Digital Twins Software Service in BelfastDigital Twins Software Service in Belfast
Digital Twins Software Service in Belfast
julia smits
 
Robotic Process Automation (RPA) Software Development Services.pptx
Robotic Process Automation (RPA) Software Development Services.pptxRobotic Process Automation (RPA) Software Development Services.pptx
Robotic Process Automation (RPA) Software Development Services.pptx
julia smits
 

Linked list using Dynamic Memory Allocation

  • 2. Linked list • A linked list is a data structure which is a sequence of nodes in which each node is linked, or connected to, the node following it. Each node element is called node. In this figure store two thing :-  An element of the list.  A link or address of the other node.
  • 3. Type of Linked List There are 4 type of linked list such as:- • Singly-linked list • Doubly linked list • Circular linked list • Circular doubly linked list.
  • 4. Operation of linked list There are some operation to be performed on the liked lists are as follows:- • Creation • Insertion • Deletion • traversing • Searching • concatenation • Display.
  • 5. Singly linked list • A singly linked list is dynamic data structure. It may grow or shrink. Growing or shrinking depends on the operations made. • In ‘c’ a linked list is created using structure , pointer and dynamic memory allocation function malloc(). We consider head as external pointer. Creating a node:- struct node { Int data; Node*next; } start; Start=NULL;
  • 6. Implementation of Linked List. • Insertion of a node at the beginning • Insertion of a node at the end • Insertion of a node after a specified node • Deletion of a particular node from the list • Traversing of entire link list.
  • 7. Inserting a node at beginning • Algorithm:- 1) Insert_first(Start, item) [Check the overflow] if ptr=NULL, then Print “overflow Exit else Ptr=(node*)malloc(size of node)); End if 2) Set ptr->Info=item 3) Set ptr->next=start 4) Set start=ptr
  • 8. Inserting a node at the end Insert _last(Start , item) 1) [check over flow?] if ptr=NULL, then print ”over flow” exit else ptr=(node*)malloc(sizeOf(node)); end if 2) Set ptr->info=item 3) Set ptr->next=NULL 4) If start=NULL and if then set start=p; 5) loc=start 6) Repeate step 7 until loc->next!=NULL 7) Loc=loc->next 8) Loc->next=p
  • 9. Insertion at the specified position C code:- void insert_spe(int item, int loc){ NODE *p,*temp; int k; for(k=0;temp=start;k<loc;k++) { temp=temp->next; If(temp==NULL){ printf(“node in the list at less than onen”); return; } } p=(NODE*)malloc(sizeof(NODE)); p->info=item; p->next=loc->next; loc->next=p; }
  • 10. Doubly Linked list • In double linked list, every node has link to its previous node and next node. we can traverse forward by using next field and can traverse backward by using previous field. Every node in a double linked list contains three fields and they are shown in the following figure...
  • 11. Doubly Linked list…continue.. Structure definition Doubly linked list:- struct node { int num; struct node*prev; struct node*node; }; typedef struct node NODE;
  • 12. Circular linked list • Circular linked list is a sequence of elements in which every element has link to its next element in the sequence and the last element has a link to the first element in the sequence. • There is no NULL at the end. • A circular linked list can be a singly circular linked list or doubly circular linked list.
  • 13. Circular linked list… continue.. • The structure definition of the circular linked.:- struct node { int info; struct node *next; }; typedef struct node *NODEPTR;
  • 14. Circular Doubly Linked list • Circular Doubly Linked List has properties of both doubly linked list and circular linked list • In which two consecutive elements are linked or connected by previous and next pointer. • And the last node points to first node by next pointer and also the first node points to last node by previous pointer
  • 15. Circular doubly linked list….. Conti.. • typedef struct _dslist_node 3 { int node_value; /* Data value */ struct _dslist_node * prev; /* pointer to previous node */ struct _dslist_node * next; /* pointer to next node */ } dslist_node;
  • 16. Advantages • List can be traversed bothways from head to tail as well as tail to head • Being a circular linked list tail can be reached with one operation from head node Disadvantages • It takes slightly extra memory in each node to accomodate previous pointer Practical Applications • Managing songs playlist in media player applications • Managing shopping cart in online shopping
  翻译: