- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Differences between stack and queue data structure
Stack and queue both are data structure to store data in particular order.
Stack is linear data structure in which objects are inserted or removed at the same end. Therefore, it is visualized as vertical collection. That is the reason why stack is called Last-in-First-out (LIFO) type of list.
Queue is also a linear data structure in which objects are inserted and removed from two different ends.Queue used two pointers to read and write data from both ends. It is a horizontal collection.
Sr. No. | Key | Stack | Queue |
---|---|---|---|
1 | Basic | Stack is linear data structure in which objects are inserted or removed at the same end | Queue is also a linear data structure in which objects are inserted and removed from two different ends |
2 | LIFO/FIFO | It is LIFO collections | It is FIFO collection |
3 | Pointers | It has only one pointer | Queue used two pointers to read and write data from both ends |
4. | Operations | Push and Pop are the operations | Queue operations are enqueue and dequeue |
- Related Articles
- Difference between Stack and Queue Data Structures
- Difference Between Stack and Queue
- Queue Data Structure in Javascript
- Stack Data Structure in Javascript
- Circular Queue Data Structure in C++
- Applications of Stack in Data Structure
- Stack and Queue in Python using queue Module
- Basic Operations for Queue in Data Structure
- Stack and Queue in C#
- Golang program to implement stack data structure
- Explain linear data structure queue in C language
- Java Program to Implement the queue data structure
- Golang program to implement the Queue data structure
- Difference between data type and data structure
- Python Program to Implement Queue Data Structure using Linked List
