SlideShare a Scribd company logo
1 of 10
Download to read offline
IPSITA RAHA | 11500120054
DIBYENDU BANIK | 11500320062
ARNAB PAUL | 11500320075
ARNAB CHATTERJEE | 11500320076
ARIJIT DHALI | 11500320078
STACK, QUEUE
& SUBROUTINE
EC 502
Computer Architecture
Group: 5
CONTENT
1. STACK OVERVIEW
2. QUEUE OVERVIEW
3. APPLICATION OF STACK AND QUEUE
4. SUBROUTINE OVERVIEW
5. SUBROUTINE APPLICATION WITH EXAMPLE
STACK
• Stack is a linear data structure which follows a particular
order in which the operations are performed. The order may
be LIFO(Last In First Out) or FILO(First In Last Out).
• Insertion and deletion takes place at one end.
Example :
Plates stacked over one another in canteen
Top
Push Pop
QUEUE
• A Queue is a linear structure which follows a particular
order in which the operations are performed. The order
is First In First Out (FIFO).
• Insertion takes place at the rear end, and deletion takes
place at the front end.
Example :
Customers standing in a line at canteen
Front
Rear
Enqueue
Dequeue
QUEUE
• Queue is used in solving problems having sequential processing.
• Applied as waiting lists for a single shared resource like CPU, Disk,
Printer.
• Applied as buffers on MP3 players and portable CD players.
• Applied on Operating system to handle interruption.
• Applied to add song at the end or to play from the front.
STACK
• Stack is used in solving problems works on recursion.
• Evaluation of Arithmetic Expressions
• Backtracking
• Delimiter Checking
• Reverse a Data
• Processing Function Calls
APPLICATION OF STACK
AND QUEUE
Stack as well as Queue are used in manipulating the flow of data in a network.
SUB ROUTINE
The block of instruction which carries out a specific and well defined task
is called a subroutine. Moreover, it is a small block of instruction, written
and stored separately.
Working principle of Sub-Routine
1. Halts the main program.
2. Provide returning to the main point.
3. Transfer control is called subroutine.
4. Executes the subroutine.
5. Revert to the main routine.
Program
Start
Subroutine
Call
Rest of
Program
Program
End
Subroutine
Start
Subroutine
Program
Subroutine
End
Main Program
Subroutine
Transfer
Return
SUB ROUTINE
• Decomposing a complex programming task into simpler steps.
• Reducing duplicate code within a program
• Enabling reuse of code across multiple programs
• Dividing a large programming task among various
programmers or various stages of a project
• Hiding implementation details from
• Improving readability of code
• Improving traceability
APPLICATIONS
EXAMPLE
SUBROUTINE
SUB multiply(INT : number)
for i runs 1 to 5
(e.g. for(i=1;i<=5;i++))
OUTPUT number * i
NEXT
END SUB
PROGRAM
INPUT num
CALL multiply(num)
CONCLUSION
• Stacks : A stack is a basic data structure that can be logically thought as
linear structure represented by a real physical stack or pile, a structure
where insertion and deletion of items takes place at one end called top of
the stack.
• Queue : Queue is an abstract data structure, somewhat similar to Stacks.
Unlike stacks, a queue is open at both its ends. One end is always used to
insert data (enqueue) and the other is used to remove data (dequeue).
• Subroutine : Subroutine is a sequence of program instructions that performs
a specific task, packaged as a unit. This unit can then be used in programs
wherever that particular task should be performed.
https://en.wikipedia.org
/wiki/Subroutine
https://www.geeksforge
eks.org/applications-of-
queue-data-structure/
01
02
03
04
05
https://www.quora.com
/
https://www.javatpoint.c
om/applications-of-
stack-in-data-structure
https://www.geeksforge
eks.org/difference-
between-stack-and-
queue-data-structures/
BIBLIOGRAPHY
THANK
YOU!
Group: 5

More Related Content

What's hot

linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure shameen khan
 
Digital System Design Basics
Digital System Design BasicsDigital System Design Basics
Digital System Design Basicsanishgoel
 
Threaded Binary Tree
Threaded Binary TreeThreaded Binary Tree
Threaded Binary Treekhabbab_h
 
Looping statements in C
Looping statements in CLooping statements in C
Looping statements in CJeya Lakshmi
 
Combinational circuits
Combinational circuits Combinational circuits
Combinational circuits DrSonali Vyas
 
Tree Traversal Algorithm in Data Structure
Tree Traversal Algorithm in Data StructureTree Traversal Algorithm in Data Structure
Tree Traversal Algorithm in Data StructureMeghaj Mallick
 
Logic gate tester for IC's ( Digital Electronics and Logic deisgn EE3114 )
Logic gate tester for IC's ( Digital Electronics and Logic deisgn EE3114 )Logic gate tester for IC's ( Digital Electronics and Logic deisgn EE3114 )
Logic gate tester for IC's ( Digital Electronics and Logic deisgn EE3114 )Jikrul Sayeed
 
Presentation on nesting of loops
Presentation on nesting of loopsPresentation on nesting of loops
Presentation on nesting of loopsbsdeol28
 
Ring Counter.pptx
Ring Counter.pptxRing Counter.pptx
Ring Counter.pptxhepzijustin
 
Arithmetic Logic Unit (ALU)
Arithmetic Logic Unit (ALU)Arithmetic Logic Unit (ALU)
Arithmetic Logic Unit (ALU)Student
 
8257 DMA Controller
8257 DMA Controller8257 DMA Controller
8257 DMA ControllerShivamSood22
 
STACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURESTACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTUREArchie Jamwal
 
Half adder & full adder
Half adder & full adderHalf adder & full adder
Half adder & full adderGaditek
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops conceptsNilesh Dalvi
 
Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)Piyush Rochwani
 

What's hot (20)

linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure
 
Digital System Design Basics
Digital System Design BasicsDigital System Design Basics
Digital System Design Basics
 
Threaded Binary Tree
Threaded Binary TreeThreaded Binary Tree
Threaded Binary Tree
 
Looping statements in C
Looping statements in CLooping statements in C
Looping statements in C
 
Combinational circuits
Combinational circuits Combinational circuits
Combinational circuits
 
Tree Traversal Algorithm in Data Structure
Tree Traversal Algorithm in Data StructureTree Traversal Algorithm in Data Structure
Tree Traversal Algorithm in Data Structure
 
Interrupt
InterruptInterrupt
Interrupt
 
Logic gate tester for IC's ( Digital Electronics and Logic deisgn EE3114 )
Logic gate tester for IC's ( Digital Electronics and Logic deisgn EE3114 )Logic gate tester for IC's ( Digital Electronics and Logic deisgn EE3114 )
Logic gate tester for IC's ( Digital Electronics and Logic deisgn EE3114 )
 
Presentation on nesting of loops
Presentation on nesting of loopsPresentation on nesting of loops
Presentation on nesting of loops
 
Ring Counter.pptx
Ring Counter.pptxRing Counter.pptx
Ring Counter.pptx
 
Arithmetic Logic Unit (ALU)
Arithmetic Logic Unit (ALU)Arithmetic Logic Unit (ALU)
Arithmetic Logic Unit (ALU)
 
8257 DMA Controller
8257 DMA Controller8257 DMA Controller
8257 DMA Controller
 
STACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURESTACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURE
 
Merge Sort
Merge SortMerge Sort
Merge Sort
 
flip flops
flip flops flip flops
flip flops
 
Arrays
ArraysArrays
Arrays
 
Half adder & full adder
Half adder & full adderHalf adder & full adder
Half adder & full adder
 
Lecture 3 instruction set
Lecture 3  instruction setLecture 3  instruction set
Lecture 3 instruction set
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops concepts
 
Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)Booth’s algorithm.(a014& a015)
Booth’s algorithm.(a014& a015)
 

Similar to Stack Queue SubRoutine

1 Introduction to C Programming.pptx
1 Introduction to C Programming.pptx1 Introduction to C Programming.pptx
1 Introduction to C Programming.pptxaarockiaabinsAPIICSE
 
Computer Architecture and Organization
Computer Architecture and OrganizationComputer Architecture and Organization
Computer Architecture and Organizationssuserdfc773
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler designKuppusamy P
 
INSTRUCTION LEVEL PARALLALISM
INSTRUCTION LEVEL PARALLALISMINSTRUCTION LEVEL PARALLALISM
INSTRUCTION LEVEL PARALLALISMKamran Ashraf
 
Programming Sessions KU Leuven - Session 03
Programming Sessions KU Leuven - Session 03Programming Sessions KU Leuven - Session 03
Programming Sessions KU Leuven - Session 03Rafael Camacho Dejay
 
Unit II - LINEAR DATA STRUCTURES
Unit II -  LINEAR DATA STRUCTURESUnit II -  LINEAR DATA STRUCTURES
Unit II - LINEAR DATA STRUCTURESUsha Mahalingam
 
Von Neumann Architecture microcontroller.pptx
Von Neumann Architecture microcontroller.pptxVon Neumann Architecture microcontroller.pptx
Von Neumann Architecture microcontroller.pptxSUNILNYATI2
 
Function Overloading,Inline Function and Recursion in C++ By Faisal Shahzad
Function Overloading,Inline Function and Recursion in C++ By Faisal ShahzadFunction Overloading,Inline Function and Recursion in C++ By Faisal Shahzad
Function Overloading,Inline Function and Recursion in C++ By Faisal ShahzadFaisal Shehzad
 
Chapter One Function.pptx
Chapter One Function.pptxChapter One Function.pptx
Chapter One Function.pptxmiki304759
 

Similar to Stack Queue SubRoutine (20)

1 Introduction to C Programming.pptx
1 Introduction to C Programming.pptx1 Introduction to C Programming.pptx
1 Introduction to C Programming.pptx
 
Computer Architecture and Organization
Computer Architecture and OrganizationComputer Architecture and Organization
Computer Architecture and Organization
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler design
 
INSTRUCTION LEVEL PARALLALISM
INSTRUCTION LEVEL PARALLALISMINSTRUCTION LEVEL PARALLALISM
INSTRUCTION LEVEL PARALLALISM
 
Parallel Programming
Parallel ProgrammingParallel Programming
Parallel Programming
 
Unit 4 COA.pptx
Unit 4 COA.pptxUnit 4 COA.pptx
Unit 4 COA.pptx
 
Presentation.pdf
Presentation.pdfPresentation.pdf
Presentation.pdf
 
Programming Sessions KU Leuven - Session 03
Programming Sessions KU Leuven - Session 03Programming Sessions KU Leuven - Session 03
Programming Sessions KU Leuven - Session 03
 
Unit II - LINEAR DATA STRUCTURES
Unit II -  LINEAR DATA STRUCTURESUnit II -  LINEAR DATA STRUCTURES
Unit II - LINEAR DATA STRUCTURES
 
2.0 Stacks.pptx
2.0 Stacks.pptx2.0 Stacks.pptx
2.0 Stacks.pptx
 
Von Neumann Architecture microcontroller.pptx
Von Neumann Architecture microcontroller.pptxVon Neumann Architecture microcontroller.pptx
Von Neumann Architecture microcontroller.pptx
 
3 Pipelining
3 Pipelining3 Pipelining
3 Pipelining
 
Plc part 3
Plc  part 3Plc  part 3
Plc part 3
 
Function Overloading,Inline Function and Recursion in C++ By Faisal Shahzad
Function Overloading,Inline Function and Recursion in C++ By Faisal ShahzadFunction Overloading,Inline Function and Recursion in C++ By Faisal Shahzad
Function Overloading,Inline Function and Recursion in C++ By Faisal Shahzad
 
layout planning
layout planninglayout planning
layout planning
 
Chapter One Function.pptx
Chapter One Function.pptxChapter One Function.pptx
Chapter One Function.pptx
 
Lec1 final
Lec1 finalLec1 final
Lec1 final
 
Functional programming in python
Functional programming in pythonFunctional programming in python
Functional programming in python
 
Functional programming in python
Functional programming in pythonFunctional programming in python
Functional programming in python
 
Presentation1(1)
Presentation1(1)Presentation1(1)
Presentation1(1)
 

More from ArijitDhali

Signal Constellation, Geometric Interpretation of Signals
Signal Constellation,  Geometric Interpretation of  SignalsSignal Constellation,  Geometric Interpretation of  Signals
Signal Constellation, Geometric Interpretation of SignalsArijitDhali
 
Overviewing the techniques of Numerical Integration.pdf
Overviewing the techniques of Numerical Integration.pdfOverviewing the techniques of Numerical Integration.pdf
Overviewing the techniques of Numerical Integration.pdfArijitDhali
 
Motorola 68020.pdf
Motorola 68020.pdfMotorola 68020.pdf
Motorola 68020.pdfArijitDhali
 
Stereotactic Radiosurgery in Brain Metastases.pdf
Stereotactic Radiosurgery in Brain Metastases.pdfStereotactic Radiosurgery in Brain Metastases.pdf
Stereotactic Radiosurgery in Brain Metastases.pdfArijitDhali
 
Active Filters.pdf
Active Filters.pdfActive Filters.pdf
Active Filters.pdfArijitDhali
 
Wideband Frequency Modulation.pdf
Wideband Frequency Modulation.pdfWideband Frequency Modulation.pdf
Wideband Frequency Modulation.pdfArijitDhali
 
Celebrity Problem.pdf
Celebrity Problem.pdfCelebrity Problem.pdf
Celebrity Problem.pdfArijitDhali
 
SSBSC Single Side Band - Suppressed Carrier Compressed
SSBSC Single Side Band - Suppressed Carrier CompressedSSBSC Single Side Band - Suppressed Carrier Compressed
SSBSC Single Side Band - Suppressed Carrier CompressedArijitDhali
 
Biodiversity Hotspots in India
Biodiversity Hotspots in IndiaBiodiversity Hotspots in India
Biodiversity Hotspots in IndiaArijitDhali
 
LTI Systems - With/Without Memory
LTI Systems - With/Without MemoryLTI Systems - With/Without Memory
LTI Systems - With/Without MemoryArijitDhali
 
RLC Series Resonance
RLC Series ResonanceRLC Series Resonance
RLC Series ResonanceArijitDhali
 
Bivariate Discrete Distribution
Bivariate Discrete DistributionBivariate Discrete Distribution
Bivariate Discrete DistributionArijitDhali
 
Dijkstra's Algorithm
Dijkstra's AlgorithmDijkstra's Algorithm
Dijkstra's AlgorithmArijitDhali
 
Conditional Probability
Conditional ProbabilityConditional Probability
Conditional ProbabilityArijitDhali
 
Isomerism of Transition Metal Complex
Isomerism of Transition Metal ComplexIsomerism of Transition Metal Complex
Isomerism of Transition Metal ComplexArijitDhali
 
Space Solar Power
Space Solar PowerSpace Solar Power
Space Solar PowerArijitDhali
 
Types of function call
Types of function callTypes of function call
Types of function callArijitDhali
 
Power Series - Legendre Polynomial - Bessel's Equation
Power Series - Legendre Polynomial - Bessel's EquationPower Series - Legendre Polynomial - Bessel's Equation
Power Series - Legendre Polynomial - Bessel's EquationArijitDhali
 

More from ArijitDhali (20)

Signal Constellation, Geometric Interpretation of Signals
Signal Constellation,  Geometric Interpretation of  SignalsSignal Constellation,  Geometric Interpretation of  Signals
Signal Constellation, Geometric Interpretation of Signals
 
Overviewing the techniques of Numerical Integration.pdf
Overviewing the techniques of Numerical Integration.pdfOverviewing the techniques of Numerical Integration.pdf
Overviewing the techniques of Numerical Integration.pdf
 
Motorola 68020.pdf
Motorola 68020.pdfMotorola 68020.pdf
Motorola 68020.pdf
 
Stereotactic Radiosurgery in Brain Metastases.pdf
Stereotactic Radiosurgery in Brain Metastases.pdfStereotactic Radiosurgery in Brain Metastases.pdf
Stereotactic Radiosurgery in Brain Metastases.pdf
 
Active Filters.pdf
Active Filters.pdfActive Filters.pdf
Active Filters.pdf
 
Wideband Frequency Modulation.pdf
Wideband Frequency Modulation.pdfWideband Frequency Modulation.pdf
Wideband Frequency Modulation.pdf
 
Celebrity Problem.pdf
Celebrity Problem.pdfCelebrity Problem.pdf
Celebrity Problem.pdf
 
SSBSC Single Side Band - Suppressed Carrier Compressed
SSBSC Single Side Band - Suppressed Carrier CompressedSSBSC Single Side Band - Suppressed Carrier Compressed
SSBSC Single Side Band - Suppressed Carrier Compressed
 
Biodiversity Hotspots in India
Biodiversity Hotspots in IndiaBiodiversity Hotspots in India
Biodiversity Hotspots in India
 
LTI Systems - With/Without Memory
LTI Systems - With/Without MemoryLTI Systems - With/Without Memory
LTI Systems - With/Without Memory
 
RLC Series Resonance
RLC Series ResonanceRLC Series Resonance
RLC Series Resonance
 
Bivariate Discrete Distribution
Bivariate Discrete DistributionBivariate Discrete Distribution
Bivariate Discrete Distribution
 
Solar Cell
Solar CellSolar Cell
Solar Cell
 
Barcode Decoder
Barcode DecoderBarcode Decoder
Barcode Decoder
 
Dijkstra's Algorithm
Dijkstra's AlgorithmDijkstra's Algorithm
Dijkstra's Algorithm
 
Conditional Probability
Conditional ProbabilityConditional Probability
Conditional Probability
 
Isomerism of Transition Metal Complex
Isomerism of Transition Metal ComplexIsomerism of Transition Metal Complex
Isomerism of Transition Metal Complex
 
Space Solar Power
Space Solar PowerSpace Solar Power
Space Solar Power
 
Types of function call
Types of function callTypes of function call
Types of function call
 
Power Series - Legendre Polynomial - Bessel's Equation
Power Series - Legendre Polynomial - Bessel's EquationPower Series - Legendre Polynomial - Bessel's Equation
Power Series - Legendre Polynomial - Bessel's Equation
 

Recently uploaded

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 

Recently uploaded (20)

(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 

Stack Queue SubRoutine

  • 1. IPSITA RAHA | 11500120054 DIBYENDU BANIK | 11500320062 ARNAB PAUL | 11500320075 ARNAB CHATTERJEE | 11500320076 ARIJIT DHALI | 11500320078 STACK, QUEUE & SUBROUTINE EC 502 Computer Architecture Group: 5
  • 2. CONTENT 1. STACK OVERVIEW 2. QUEUE OVERVIEW 3. APPLICATION OF STACK AND QUEUE 4. SUBROUTINE OVERVIEW 5. SUBROUTINE APPLICATION WITH EXAMPLE
  • 3. STACK • Stack is a linear data structure which follows a particular order in which the operations are performed. The order may be LIFO(Last In First Out) or FILO(First In Last Out). • Insertion and deletion takes place at one end. Example : Plates stacked over one another in canteen Top Push Pop
  • 4. QUEUE • A Queue is a linear structure which follows a particular order in which the operations are performed. The order is First In First Out (FIFO). • Insertion takes place at the rear end, and deletion takes place at the front end. Example : Customers standing in a line at canteen Front Rear Enqueue Dequeue
  • 5. QUEUE • Queue is used in solving problems having sequential processing. • Applied as waiting lists for a single shared resource like CPU, Disk, Printer. • Applied as buffers on MP3 players and portable CD players. • Applied on Operating system to handle interruption. • Applied to add song at the end or to play from the front. STACK • Stack is used in solving problems works on recursion. • Evaluation of Arithmetic Expressions • Backtracking • Delimiter Checking • Reverse a Data • Processing Function Calls APPLICATION OF STACK AND QUEUE Stack as well as Queue are used in manipulating the flow of data in a network.
  • 6. SUB ROUTINE The block of instruction which carries out a specific and well defined task is called a subroutine. Moreover, it is a small block of instruction, written and stored separately. Working principle of Sub-Routine 1. Halts the main program. 2. Provide returning to the main point. 3. Transfer control is called subroutine. 4. Executes the subroutine. 5. Revert to the main routine. Program Start Subroutine Call Rest of Program Program End Subroutine Start Subroutine Program Subroutine End Main Program Subroutine Transfer Return
  • 7. SUB ROUTINE • Decomposing a complex programming task into simpler steps. • Reducing duplicate code within a program • Enabling reuse of code across multiple programs • Dividing a large programming task among various programmers or various stages of a project • Hiding implementation details from • Improving readability of code • Improving traceability APPLICATIONS EXAMPLE SUBROUTINE SUB multiply(INT : number) for i runs 1 to 5 (e.g. for(i=1;i<=5;i++)) OUTPUT number * i NEXT END SUB PROGRAM INPUT num CALL multiply(num)
  • 8. CONCLUSION • Stacks : A stack is a basic data structure that can be logically thought as linear structure represented by a real physical stack or pile, a structure where insertion and deletion of items takes place at one end called top of the stack. • Queue : Queue is an abstract data structure, somewhat similar to Stacks. Unlike stacks, a queue is open at both its ends. One end is always used to insert data (enqueue) and the other is used to remove data (dequeue). • Subroutine : Subroutine is a sequence of program instructions that performs a specific task, packaged as a unit. This unit can then be used in programs wherever that particular task should be performed.