---
title: "What is the difference between stack and queue?"  
description: "What is the difference between stack and queue?"  
author: "Sanjay Goenka"  
published: 2022-04-06  
canonical: https://answers.mindstick.com/qa/96765/what-is-the-difference-between-stack-and-queue  
category: "troubleshooting"  
tags: ["troubleshooting", "software engineering", "software"]  
reading_time: 1 minute  

---

# What is the difference between stack and queue?

What is the [difference](https://www.mindstick.com/blog/398/difference-between-object-type-and-var-type) between [stack](https://www.mindstick.com/blog/301746/why-is-stack-overflow-so-important-for-developers) and [queue](https://www.mindstick.com/forum/160388/describe-the-basic-features-and-use-cases-of-the-queue-and-stack-collections-in-c-sharp)?

## Answers

### Answer by Hitesh Vohra

- A **stack** is a linear data structure in which elements can only be added or removed from the top side of the list. The LIFO (Last In First Out) principle dictates that the element put last is the first to come out of a stack. Pushing an element into a stack is referred to as a push operation, while removing an element from a stack is referred to as a pop operation. With a pointer called top, we always maintain track of the last entry in the list in stack.
- A queue is a linear data structure in which elements can only be inserted from one side of the list, called the back, and only deleted from the other side, called the front. The FIFO (First In First Out) principle governs the queue data structure, which means that the element placed first in the list is the first one withdrawn from the list.

\

**Read More: [Explain the differences between a Thread and a Process?](https://answers.mindstick.com/qa/96763/explain-the-differences-between-a-thread-and-a-process)**


---

Original Source: https://answers.mindstick.com/qa/96765/what-is-the-difference-between-stack-and-queue

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
