Submit Search
Upload
IRJET- Comparison of Stack and Queue Data Structures
•
0 likes
•
29 views
IRJET Journal
Follow
https://www.irjet.net/archives/V6/i6/IRJET-V6I6737.pdf
Read less
Read more
Engineering
Report
Share
Report
Share
1 of 4
Download now
Download to read offline
Recommended
What is Stack, Its Operations, Queue, Circular Queue, Priority Queue
What is Stack, Its Operations, Queue, Circular Queue, Priority Queue
Balwant Gorad
Computer Science-Data Structures :Abstract DataType (ADT)
Computer Science-Data Structures :Abstract DataType (ADT)
St Mary's College,Thrissur,Kerala
Queues
Queues
Lovely Professional University
Queue
Queue
Budditha Hettige
Stack and queue
Stack and queue
Anil Kumar Prajapati
Study & Analysis of Complexities of Stack & Queue Operations in Data Structure
Study & Analysis of Complexities of Stack & Queue Operations in Data Structure
Meghaj Mallick
Circular queue
Circular queue
Lovely Professional University
My lectures circular queue
My lectures circular queue
Senthil Kumar
Recommended
What is Stack, Its Operations, Queue, Circular Queue, Priority Queue
What is Stack, Its Operations, Queue, Circular Queue, Priority Queue
Balwant Gorad
Computer Science-Data Structures :Abstract DataType (ADT)
Computer Science-Data Structures :Abstract DataType (ADT)
St Mary's College,Thrissur,Kerala
Queues
Queues
Lovely Professional University
Queue
Queue
Budditha Hettige
Stack and queue
Stack and queue
Anil Kumar Prajapati
Study & Analysis of Complexities of Stack & Queue Operations in Data Structure
Study & Analysis of Complexities of Stack & Queue Operations in Data Structure
Meghaj Mallick
Circular queue
Circular queue
Lovely Professional University
My lectures circular queue
My lectures circular queue
Senthil Kumar
Dsa circular queue
Dsa circular queue
zzzubair
Data Structure (Queue)
Data Structure (Queue)
Adam Mukharil Bachtiar
Queue
Queue
Swarup Kumar Boro
Queue
Queue
Raj Sarode
queue & its applications
queue & its applications
somendra kumar
Circular Queue data structure
Circular Queue data structure
Dhananjaysinh Jhala
Queue data structure
Queue data structure
anooppjoseph
basics of queues
basics of queues
sirmanohar
Queue Data Structure
Queue Data Structure
Lovely Professional University
Priority queues
Priority queues
Priyanka Rana
Ds
Ds
Subha Selvam
Queues
Queues
Ashim Lamichhane
Foss4 g topology_july_16_2015
Foss4 g topology_july_16_2015
Lars Aksel Opsahl
Unit 5 dsa QUEUE
Unit 5 dsa QUEUE
PUNE VIDYARTHI GRIHA'S COLLEGE OF ENGINEERING, NASHIK
Queue ppt
Queue ppt
SouravKumar328
Introduction to data structure
Introduction to data structure
Vivek Kumar Sinha
Queue AS an ADT (Abstract Data Type)
Queue AS an ADT (Abstract Data Type)
Self-Employed
Queue
Queue
Allana Institute of management sciences
المحاضرة الثامنة: تراكيب البيانات الطابور
المحاضرة الثامنة: تراكيب البيانات الطابور
Mahmoud Alfarra
Link List
Link List
Budditha Hettige
DSA Lab Manual C Scheme.pdf
DSA Lab Manual C Scheme.pdf
Bharati Vidyapeeth COE, Navi Mumbai
Difference between stack and queue
Difference between stack and queue
Pulkitmodi1998
More Related Content
What's hot
Dsa circular queue
Dsa circular queue
zzzubair
Data Structure (Queue)
Data Structure (Queue)
Adam Mukharil Bachtiar
Queue
Queue
Swarup Kumar Boro
Queue
Queue
Raj Sarode
queue & its applications
queue & its applications
somendra kumar
Circular Queue data structure
Circular Queue data structure
Dhananjaysinh Jhala
Queue data structure
Queue data structure
anooppjoseph
basics of queues
basics of queues
sirmanohar
Queue Data Structure
Queue Data Structure
Lovely Professional University
Priority queues
Priority queues
Priyanka Rana
Ds
Ds
Subha Selvam
Queues
Queues
Ashim Lamichhane
Foss4 g topology_july_16_2015
Foss4 g topology_july_16_2015
Lars Aksel Opsahl
Unit 5 dsa QUEUE
Unit 5 dsa QUEUE
PUNE VIDYARTHI GRIHA'S COLLEGE OF ENGINEERING, NASHIK
Queue ppt
Queue ppt
SouravKumar328
Introduction to data structure
Introduction to data structure
Vivek Kumar Sinha
Queue AS an ADT (Abstract Data Type)
Queue AS an ADT (Abstract Data Type)
Self-Employed
Queue
Queue
Allana Institute of management sciences
المحاضرة الثامنة: تراكيب البيانات الطابور
المحاضرة الثامنة: تراكيب البيانات الطابور
Mahmoud Alfarra
Link List
Link List
Budditha Hettige
What's hot
(20)
Dsa circular queue
Dsa circular queue
Data Structure (Queue)
Data Structure (Queue)
Queue
Queue
Queue
Queue
queue & its applications
queue & its applications
Circular Queue data structure
Circular Queue data structure
Queue data structure
Queue data structure
basics of queues
basics of queues
Queue Data Structure
Queue Data Structure
Priority queues
Priority queues
Ds
Ds
Queues
Queues
Foss4 g topology_july_16_2015
Foss4 g topology_july_16_2015
Unit 5 dsa QUEUE
Unit 5 dsa QUEUE
Queue ppt
Queue ppt
Introduction to data structure
Introduction to data structure
Queue AS an ADT (Abstract Data Type)
Queue AS an ADT (Abstract Data Type)
Queue
Queue
المحاضرة الثامنة: تراكيب البيانات الطابور
المحاضرة الثامنة: تراكيب البيانات الطابور
Link List
Link List
Similar to IRJET- Comparison of Stack and Queue Data Structures
DSA Lab Manual C Scheme.pdf
DSA Lab Manual C Scheme.pdf
Bharati Vidyapeeth COE, Navi Mumbai
Difference between stack and queue
Difference between stack and queue
Pulkitmodi1998
chapter three ppt.pptx
chapter three ppt.pptx
selemonGamo
TSAT Presentation1.pptx
TSAT Presentation1.pptx
Rajitha Reddy Alugati
Data structures
Data structures
naveeth babu
Stack and queue
Stack and queue
CHANDAN KUMAR
computer notes - Memory organization
computer notes - Memory organization
ecomputernotes
Data structure , stack , queue
Data structure , stack , queue
Rajkiran Nadar
Stack in C.pptx
Stack in C.pptx
RituSarkar7
Data Structure
Data Structure
Ibrahim MH
VCE Unit 03vv.pptx
VCE Unit 03vv.pptx
skilljiolms
Stack Data Structure with Static Implementation (2).pptx
Stack Data Structure with Static Implementation (2).pptx
Emroz Sardar
Ist year Msc,2nd sem module1
Ist year Msc,2nd sem module1
blessyboban92
Sorting Algorithms
Sorting Algorithms
IRJET Journal
Abstract Data Types (a) Explain briefly what is meant by the ter.pdf
Abstract Data Types (a) Explain briefly what is meant by the ter.pdf
karymadelaneyrenne19
Data structure stack&queue basics
Data structure stack&queue basics
Selvin Josy Bai Somu
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pd
Nimmi Weeraddana
2 b queues
2 b queues
Nguync91368
Stacks queues-1220971554378778-9
Stacks queues-1220971554378778-9
Getachew Ganfur
Rana Junaid Rasheed
Rana Junaid Rasheed
Rana junaid Rasheed
Similar to IRJET- Comparison of Stack and Queue Data Structures
(20)
DSA Lab Manual C Scheme.pdf
DSA Lab Manual C Scheme.pdf
Difference between stack and queue
Difference between stack and queue
chapter three ppt.pptx
chapter three ppt.pptx
TSAT Presentation1.pptx
TSAT Presentation1.pptx
Data structures
Data structures
Stack and queue
Stack and queue
computer notes - Memory organization
computer notes - Memory organization
Data structure , stack , queue
Data structure , stack , queue
Stack in C.pptx
Stack in C.pptx
Data Structure
Data Structure
VCE Unit 03vv.pptx
VCE Unit 03vv.pptx
Stack Data Structure with Static Implementation (2).pptx
Stack Data Structure with Static Implementation (2).pptx
Ist year Msc,2nd sem module1
Ist year Msc,2nd sem module1
Sorting Algorithms
Sorting Algorithms
Abstract Data Types (a) Explain briefly what is meant by the ter.pdf
Abstract Data Types (a) Explain briefly what is meant by the ter.pdf
Data structure stack&queue basics
Data structure stack&queue basics
Data structures and algorithms short note (version 14).pd
Data structures and algorithms short note (version 14).pd
2 b queues
2 b queues
Stacks queues-1220971554378778-9
Stacks queues-1220971554378778-9
Rana Junaid Rasheed
Rana Junaid Rasheed
More from IRJET Journal
TUNNELING IN HIMALAYAS WITH NATM METHOD: A SPECIAL REFERENCES TO SUNGAL TUNNE...
TUNNELING IN HIMALAYAS WITH NATM METHOD: A SPECIAL REFERENCES TO SUNGAL TUNNE...
IRJET Journal
STUDY THE EFFECT OF RESPONSE REDUCTION FACTOR ON RC FRAMED STRUCTURE
STUDY THE EFFECT OF RESPONSE REDUCTION FACTOR ON RC FRAMED STRUCTURE
IRJET Journal
A COMPARATIVE ANALYSIS OF RCC ELEMENT OF SLAB WITH STARK STEEL (HYSD STEEL) A...
A COMPARATIVE ANALYSIS OF RCC ELEMENT OF SLAB WITH STARK STEEL (HYSD STEEL) A...
IRJET Journal
Effect of Camber and Angles of Attack on Airfoil Characteristics
Effect of Camber and Angles of Attack on Airfoil Characteristics
IRJET Journal
A Review on the Progress and Challenges of Aluminum-Based Metal Matrix Compos...
A Review on the Progress and Challenges of Aluminum-Based Metal Matrix Compos...
IRJET Journal
Dynamic Urban Transit Optimization: A Graph Neural Network Approach for Real-...
Dynamic Urban Transit Optimization: A Graph Neural Network Approach for Real-...
IRJET Journal
Structural Analysis and Design of Multi-Storey Symmetric and Asymmetric Shape...
Structural Analysis and Design of Multi-Storey Symmetric and Asymmetric Shape...
IRJET Journal
A Review of “Seismic Response of RC Structures Having Plan and Vertical Irreg...
A Review of “Seismic Response of RC Structures Having Plan and Vertical Irreg...
IRJET Journal
A REVIEW ON MACHINE LEARNING IN ADAS
A REVIEW ON MACHINE LEARNING IN ADAS
IRJET Journal
Long Term Trend Analysis of Precipitation and Temperature for Asosa district,...
Long Term Trend Analysis of Precipitation and Temperature for Asosa district,...
IRJET Journal
P.E.B. Framed Structure Design and Analysis Using STAAD Pro
P.E.B. Framed Structure Design and Analysis Using STAAD Pro
IRJET Journal
A Review on Innovative Fiber Integration for Enhanced Reinforcement of Concre...
A Review on Innovative Fiber Integration for Enhanced Reinforcement of Concre...
IRJET Journal
Survey Paper on Cloud-Based Secured Healthcare System
Survey Paper on Cloud-Based Secured Healthcare System
IRJET Journal
Review on studies and research on widening of existing concrete bridges
Review on studies and research on widening of existing concrete bridges
IRJET Journal
React based fullstack edtech web application
React based fullstack edtech web application
IRJET Journal
A Comprehensive Review of Integrating IoT and Blockchain Technologies in the ...
A Comprehensive Review of Integrating IoT and Blockchain Technologies in the ...
IRJET Journal
A REVIEW ON THE PERFORMANCE OF COCONUT FIBRE REINFORCED CONCRETE.
A REVIEW ON THE PERFORMANCE OF COCONUT FIBRE REINFORCED CONCRETE.
IRJET Journal
Optimizing Business Management Process Workflows: The Dynamic Influence of Mi...
Optimizing Business Management Process Workflows: The Dynamic Influence of Mi...
IRJET Journal
Multistoried and Multi Bay Steel Building Frame by using Seismic Design
Multistoried and Multi Bay Steel Building Frame by using Seismic Design
IRJET Journal
Cost Optimization of Construction Using Plastic Waste as a Sustainable Constr...
Cost Optimization of Construction Using Plastic Waste as a Sustainable Constr...
IRJET Journal
More from IRJET Journal
(20)
TUNNELING IN HIMALAYAS WITH NATM METHOD: A SPECIAL REFERENCES TO SUNGAL TUNNE...
TUNNELING IN HIMALAYAS WITH NATM METHOD: A SPECIAL REFERENCES TO SUNGAL TUNNE...
STUDY THE EFFECT OF RESPONSE REDUCTION FACTOR ON RC FRAMED STRUCTURE
STUDY THE EFFECT OF RESPONSE REDUCTION FACTOR ON RC FRAMED STRUCTURE
A COMPARATIVE ANALYSIS OF RCC ELEMENT OF SLAB WITH STARK STEEL (HYSD STEEL) A...
A COMPARATIVE ANALYSIS OF RCC ELEMENT OF SLAB WITH STARK STEEL (HYSD STEEL) A...
Effect of Camber and Angles of Attack on Airfoil Characteristics
Effect of Camber and Angles of Attack on Airfoil Characteristics
A Review on the Progress and Challenges of Aluminum-Based Metal Matrix Compos...
A Review on the Progress and Challenges of Aluminum-Based Metal Matrix Compos...
Dynamic Urban Transit Optimization: A Graph Neural Network Approach for Real-...
Dynamic Urban Transit Optimization: A Graph Neural Network Approach for Real-...
Structural Analysis and Design of Multi-Storey Symmetric and Asymmetric Shape...
Structural Analysis and Design of Multi-Storey Symmetric and Asymmetric Shape...
A Review of “Seismic Response of RC Structures Having Plan and Vertical Irreg...
A Review of “Seismic Response of RC Structures Having Plan and Vertical Irreg...
A REVIEW ON MACHINE LEARNING IN ADAS
A REVIEW ON MACHINE LEARNING IN ADAS
Long Term Trend Analysis of Precipitation and Temperature for Asosa district,...
Long Term Trend Analysis of Precipitation and Temperature for Asosa district,...
P.E.B. Framed Structure Design and Analysis Using STAAD Pro
P.E.B. Framed Structure Design and Analysis Using STAAD Pro
A Review on Innovative Fiber Integration for Enhanced Reinforcement of Concre...
A Review on Innovative Fiber Integration for Enhanced Reinforcement of Concre...
Survey Paper on Cloud-Based Secured Healthcare System
Survey Paper on Cloud-Based Secured Healthcare System
Review on studies and research on widening of existing concrete bridges
Review on studies and research on widening of existing concrete bridges
React based fullstack edtech web application
React based fullstack edtech web application
A Comprehensive Review of Integrating IoT and Blockchain Technologies in the ...
A Comprehensive Review of Integrating IoT and Blockchain Technologies in the ...
A REVIEW ON THE PERFORMANCE OF COCONUT FIBRE REINFORCED CONCRETE.
A REVIEW ON THE PERFORMANCE OF COCONUT FIBRE REINFORCED CONCRETE.
Optimizing Business Management Process Workflows: The Dynamic Influence of Mi...
Optimizing Business Management Process Workflows: The Dynamic Influence of Mi...
Multistoried and Multi Bay Steel Building Frame by using Seismic Design
Multistoried and Multi Bay Steel Building Frame by using Seismic Design
Cost Optimization of Construction Using Plastic Waste as a Sustainable Constr...
Cost Optimization of Construction Using Plastic Waste as a Sustainable Constr...
Recently uploaded
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
ranjana rawat
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
upamatechverse
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
SIVASHANKAR N
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
ssuser5c9d4b1
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
Tsuyoshi Horigome
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
KurinjimalarL3
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
slot gacor bisa pakai pulsa
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
ranjana rawat
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
purnimasatapathy1234
(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
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
upamatechverse
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
Asutosh Ranjan
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur High Profile
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Call Girls in Nagpur High Profile
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
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Call Girls in Nagpur High Profile
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
rknatarajan
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
upamatechverse
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
rakeshbaidya232001
Recently uploaded
(20)
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.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...
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
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...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
IRJET- Comparison of Stack and Queue Data Structures
1.
International Research Journal
of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 06 Issue: 06 | June 2019 www.irjet.net p-ISSN: 2395-0072 © 2019, IRJET | Impact Factor value: 7.211 | ISO 9001:2008 Certified Journal | Page 3670 Comparison of Stack and Queue Data structures Regi Maliyekkel S1, Anila M2 1HSST Computer Science, GHSS Vattenad, Palakkad, Kerala, India 2Asst Professor on Conract, University Centre, Manjery, Kerala, India --------------------------------------------------------------------------***---------------------------------------------------------------------------- Abstract - This paper describes the comparative study of the very familiar Data structures Stack and Queue. While solving problems using computers, the data may have to be processed. These data may be of atomic type or grouped (aggregate). The grouped data are refereed using arrays and structures. Stack and Queue are non-primitive datastructures and are used for storing data elements and are actually based on some real world equivalent. The main differences between stack and queue are that stack uses LIFO (last in first out) method to access and add data elements whereas Queue uses FIFO (First in first out) method to accessand add. Basedon the analysis, a comparative study is being made thus the user can easily understand the working principle and operations of these two data structures. Key Words: Stack, Push, Pop, Queue, Deletion, Insertion, Comparison 1. INTRODUCTION The concept of data structure is similar to the collections of plates in a stand, a set of disks in a CD pack and a queue in which a new person can join the queue only at the rear end. In computer science Data structure is a particular way of organizing similar or dissimilar data items logically and can be considered as a single unit. Since data structures represents collections of data, these are closely related to computer memory, as it is the storage space for data. Here give a comparison study on two very familiar data structures Stack and Queue. 1.1 Stack The Stack is formed by placing each item one over the other. We can say that the items are addedatthetopposition. And also wecan remove thatitem whichisplacedatlast.This is the Last-In-First-Out (LIFO) principle. The Stack follows LIFO principle. In Stack all Insertions and deletions of data items are done at one end called Top. Implementation of stack using array Stack can be implementedasarray,insuchacase,there is a limit to the number of elements that can be represented by the stack and it depends on the size of the array. STACK 40 25 32 10 0 1 2 3 4 5 TOS Figure -1 In the above figure- 1 TOS indicates Top Of Stack (Last position of the element in the stack). So by STACK[TOS] indicates the value of the last data item of the stack. Initially the value of TOS set to -1. 1.1.1. Operations on Stack Two Operations are possible on stack Push and Pop. Push is for inserting data items into stack and Pop is for removing data items from it. Push Operation Push Operation is the process of insertinganewdata item into Stack. The following Algorithm shows the Push Operation on a Stack. For this consider an array Stack[S] that implements a stack, where S is the maximum size of the array. Figure - 2 Step 1: If TOS< S Then ( For checking Space availability) Step 2: TOS=TOS+1 Step 3: Stack[TOS]= Val Step 4: Else
2.
International Research Journal
of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 06 Issue: 06 | June 2019 www.irjet.net p-ISSN: 2395-0072 © 2019, IRJET | Impact Factor value: 7.211 | ISO 9001:2008 Certified Journal | Page 3671 Step 5: Print “Stack Overflow” Step 6: End of If Pop Operation Pop operation is the process of deleting an element from the top of Stack. After every deletion,theTOSis decremented by One.ThefollowingAlgorithm showsthePop Operation on a Stack. For this consider an array Stack[S] that implements a stack, where S is the maximum size of the array. Figure -3 Step 1: If TOS> -1 Then ( For checking Empty Stack) Step 2: Val=Stack[TOS] Step 3: TOS=TOS-1 Step 4: Else Step 5: Print “Stack Underflow” Step 6: End of If 1.2 Queue We might have became part of queue in our life like billing payment in shops in which one person at the front position billing the payment fist and a new person can join the queue at the rear position. This style of Organizing a group is called Fist-In-First-Out(FIFO) principle. A data structure that follows FIFO is called Queue. Implementation of Queue using array Figure shows a queue using array of integerswhich can accommodate maximum 6 elements. It contains 5 elements and Front value is 0 and Rear value is 4. The first element is represented by QUEUE[FRONT] and the last element is QUEUE[REAR]. 1.2.1. Operations on Queue Insertion and Deletion are the two operations performed on Queue Insertion Operation Adding a data element into a queue at the rear end is called Insertion. Following shows Algorithm for Insertion Operations. For this Consider an array QUEUE[S] that implements a queue of Size S. The variable Front and Rear keep track of the position value of FrontandRearelementsof the queue. Figure -4 Step 1: If (REAR== -1) Then ( For checking Empty Queue) Step 2: FRONT=REAR=0 Step 3: QUEUE[REAR]=Val
3.
International Research Journal
of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 06 Issue: 06 | June 2019 www.irjet.net p-ISSN: 2395-0072 © 2019, IRJET | Impact Factor value: 7.211 | ISO 9001:2008 Certified Journal | Page 3672 Step 4: Else If(REAR < S) Then Step 5: REAR=REAR+1 Step 6: QUEUE[REAR]=Val Step 7: Else Step 8: Print “Queue Overflow” Step 9: End of if Deletion Operation Removal of data items fromthefront endofqueueis called Deletion operation. Following shows Algorithm for Deletion Operation. For this Consider an array QUEUE[S] that implements a queue of Size S. The variable Front and Rear keep track of the position value of Front and Rear elements of the queue. Figure -5 Step 1: If (FRONT. -1 AND FRONT < REAR) Then (For checking Empty Queue) Step 2 : Val=QUEUE[FRONT] Step 3 : FRONT=FRONT+1 Step 4 : Else Step 5 : Print “Queue Underflow” Step 6 : End of If Step 7: If (FRONT>REAR) Then (last element deletion checking) Step 8: FRONT=REAR= -1 Step 9 : End of if 2. Comparison between Stack and Queue Stack Queue Principle LIFO FIFO Variables TOS FRONT REAR Operations PUSH POP Insertion Deletion Time Complexity O(1)(Inserting Item) O(1)(Removing Item) O(1)(Inserting Item) O(n)(Removing Item in worst case) Table -1 3. CONCLUSION It can be concluded that we have seen the comparison study of the two popular Data structure Stack and Queue. And also explained the different operations performed on these with proper Algorithms. Both are linear data structures differ in certain ways like working mechanism, structure, implementation, variants but both are used for storing the elements in thelistandperformingoperationson the list like addition and deletion of the elements. Parsing in a compiler. Stack used in Java virtual machine, Undo in a word processor, Back button in a Web browser etc and Queue used in Data Buffers, Asynchronous data transfer (fileIO, pipes, sockets), Traffic analysis etc. REFERENCES [1] https://techdifferences.com/difference-between-stack- and-queue.html [2] https://www.geeksforgeeks.org/difference- between-
4.
International Research Journal
of Engineering and Technology (IRJET) e-ISSN: 2395-0056 Volume: 06 Issue: 06 | June 2019 www.irjet.net p-ISSN: 2395-0072 © 2019, IRJET | Impact Factor value: 7.211 | ISO 9001:2008 Certified Journal | Page 3673 stack-and-queue-data-structures/ [3] https://ieeexplore.ieee.org/document/979991 Journals & Magazines Volume: 28 Issue: 1 [4] IEEE Transactions on Software Engineering (Volume: 28 , Issue: 1 , Jan 2002 ) [5] Donald Knuth. The Art of Computer Programming Volume1:FundamentalAlgorithms, Addison Wesley, 1997. [6] RESEARCH PAPER ON STACK AND QUEUE Nitesh, Manbir Singh, Rahul Yadav 2014 IJIRT Volume 1 Issue 7 | ISSN: 2349
Download now