SlideShare a Scribd company logo
STACK USING LINKED LIST
PUSH
30
STACK USING LINKED LIST
POP
31
STACK USING LINKED LIST
ALGORITHM FOR PUSH OPERATION
1. Input the VALUE to be pushed
2. Creat a New Node
3. NewNode → DATA = VALUE
4. NewNode → Next = TOP
5. TOP = NewNode
6. Exit
32
STACK USING LINKED LIST
• ALGORITHM FOR POP OPERATION
1. if (TOP is equal to NULL)
Display "The stack is
empty"
2. Else
(a) TEMP = TOP
(b) Display "The popped
element TOP → DATA"
(c) TOP = TOP → Next
(d) Free the TEMP node
3. Exit
33
34
QUEUE USING LINKED LIST
ADD to queue
QUEUE USING LINKED LIST
REMOVE from queue
35

More Related Content

More from Anil Yadav (20)

PPT
Lec-12, 13 Quee s Applications of Queues
Anil Yadav
 
PPT
Lec-12, 13 Quees Array Implementation IN
Anil Yadav
 
PPT
Lec-12, 13 Quees In Queue IntQueue(int s)
Anil Yadav
 
PPT
Lec-12, 13 Quees A class for Dynamic Queue implementation
Anil Yadav
 
PPT
Function enqueue inserts the value in num
Anil Yadav
 
PPT
Lec-12, 13 Quees -How to determine empty and full Queues?
Anil Yadav
 
PDF
Unit2-BIS Business Information system Data
Anil Yadav
 
PPT
Lec-12, 13 Queues - IntQueue IntQueue(int s) //constructor
Anil Yadav
 
PPT
Lec-12, 13 Quees Another implementation of Queues using Arrays
Anil Yadav
 
PPT
Lec-12, 13 Quees - Circular Queues and Implementation with Array
Anil Yadav
 
PPT
Lec-32 Recursion - Divide and Conquer in Queue
Anil Yadav
 
PPT
Lec-32 Recursion -Recursion in Computer Science
Anil Yadav
 
PPT
Lec-32 What is recursion? A mathematical look
Anil Yadav
 
PPTX
The word or can be interpreted in two distinct ways:
Anil Yadav
 
PPTX
A proposition makes a claim (either an assertion or a denial) that may be eit...
Anil Yadav
 
PPT
Lec-23,24 Sets A Bit-Vector Implementation of Sets
Anil Yadav
 
PPT
linked-list - Abstract data type (ADT) Linked Lists
Anil Yadav
 
PPT
linked-list - Finding a node Deleting a node
Anil Yadav
 
PPT
Lec-35Graph - Graph - Copy in Data Structure
Anil Yadav
 
PPT
Lec-35Graph - Copy Graph therory in Data strucure
Anil Yadav
 
Lec-12, 13 Quee s Applications of Queues
Anil Yadav
 
Lec-12, 13 Quees Array Implementation IN
Anil Yadav
 
Lec-12, 13 Quees In Queue IntQueue(int s)
Anil Yadav
 
Lec-12, 13 Quees A class for Dynamic Queue implementation
Anil Yadav
 
Function enqueue inserts the value in num
Anil Yadav
 
Lec-12, 13 Quees -How to determine empty and full Queues?
Anil Yadav
 
Unit2-BIS Business Information system Data
Anil Yadav
 
Lec-12, 13 Queues - IntQueue IntQueue(int s) //constructor
Anil Yadav
 
Lec-12, 13 Quees Another implementation of Queues using Arrays
Anil Yadav
 
Lec-12, 13 Quees - Circular Queues and Implementation with Array
Anil Yadav
 
Lec-32 Recursion - Divide and Conquer in Queue
Anil Yadav
 
Lec-32 Recursion -Recursion in Computer Science
Anil Yadav
 
Lec-32 What is recursion? A mathematical look
Anil Yadav
 
The word or can be interpreted in two distinct ways:
Anil Yadav
 
A proposition makes a claim (either an assertion or a denial) that may be eit...
Anil Yadav
 
Lec-23,24 Sets A Bit-Vector Implementation of Sets
Anil Yadav
 
linked-list - Abstract data type (ADT) Linked Lists
Anil Yadav
 
linked-list - Finding a node Deleting a node
Anil Yadav
 
Lec-35Graph - Graph - Copy in Data Structure
Anil Yadav
 
Lec-35Graph - Copy Graph therory in Data strucure
Anil Yadav
 

Recently uploaded (20)

PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PPTX
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
PPTX
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
PPTX
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PPTX
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PDF
Characteristics, Strengths and Weaknesses of Quantitative Research.pdf
Thelma Villaflores
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
PPTX
QUARTER 1 WEEK 2 PLOT, POV AND CONFLICTS
KynaParas
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
PPT-Q1-WK-3-ENGLISH Revised Matatag Grade 3.pptx
reijhongidayawan02
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
EDUCATIONAL MEDIA/ TEACHING AUDIO VISUAL AIDS
Sonali Gupta
 
Dimensions of Societal Planning in Commonism
StefanMz
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
Characteristics, Strengths and Weaknesses of Quantitative Research.pdf
Thelma Villaflores
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
How to Handle Salesperson Commision in Odoo 18 Sales
Celine George
 
QUARTER 1 WEEK 2 PLOT, POV AND CONFLICTS
KynaParas
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
Ad

Link List STACK and Queue USING LINKED LIST

  • 1. STACK USING LINKED LIST PUSH 30
  • 2. STACK USING LINKED LIST POP 31
  • 3. STACK USING LINKED LIST ALGORITHM FOR PUSH OPERATION 1. Input the VALUE to be pushed 2. Creat a New Node 3. NewNode → DATA = VALUE 4. NewNode → Next = TOP 5. TOP = NewNode 6. Exit 32
  • 4. STACK USING LINKED LIST • ALGORITHM FOR POP OPERATION 1. if (TOP is equal to NULL) Display "The stack is empty" 2. Else (a) TEMP = TOP (b) Display "The popped element TOP → DATA" (c) TOP = TOP → Next (d) Free the TEMP node 3. Exit 33
  • 5. 34 QUEUE USING LINKED LIST ADD to queue
  • 6. QUEUE USING LINKED LIST REMOVE from queue 35