×
Home Discussions Write at Opengenus IQ
×
  • DSA Cheatsheet
  • HOME
  • Track your progress
  • Deep Learning (FREE)
  • Join our Internship 🎓
  • RANDOM
  • One Liner

Stack

Stack is a common yet very useful data structure which is defined as LIFO (Last In First Out). This is the list of problems and topics on Stack at OpenGenus.

Data Structures

Dynamic Stack

Dynamic Stack, just like Dynamic Array, is a stack data structure whose the length or capacity (maximum number of elements that can be stored) increases or decreases in real time based on the operations (like insertion or deletion) performed on it.

Aarushi Ghadiya
Software Engineering

Initialize Stack in C++ STL

std::stack is a type of container adapter, specifically designed to operate in a LIFO fashion elements can be inserted or removed from only one end

Eashwaran Raghu Eashwaran Raghu
Algorithms

Converting Postfix to Infix using Stack

We have explored an algorithm to convert a Postfix expression to Infix expression using Stack. This takes linear time O(N)

Akshay Gopani Akshay Gopani
C++

Stack in C++ STL

Stack in the STL of C++ is a dynamically resizing container. Stack class is an container adapter. Containers or container classes store objects and data. There are in total seven standard "first-class" container classes and three container adaptor classes and only seven header files

Piyush Rajendra Chaudhari Piyush Rajendra Chaudhari
Data Structures

Implementing Stack using queues in two ways

A stack is based on the principle of Last-in-First-Out(LIFO). It is commonly used abstract data type with two major operations, namely pop and push. Push() and pop() are carried out in the topmost element, which is the item most recently added to the stack. Push operation adds an element to stack

Vaibhav Gupta
Data Structures

Stack

Stack serves two principal operations: push, which adds an element to the collection, and pop, which removes the most recently added element that was not yet removed. We have covered functions like top, isFull, isEmpty, peek, pop, push and given an implementation example

Shreya Gupta Shreya Gupta
Algorithms

Conversion of Infix to Postfix Expression using Stack

To convert Infix expression to Postfix expression, we will use the stack data structure. By scanning the infix expression from left to right,if we get any operand, simply add it to the postfix form, and for the operator and parenthesis, add them in the stack maintaining the precedence of them.

Piyush Rajendra Chaudhari Piyush Rajendra Chaudhari
Data Structures

Implementing Queue using Stack in two ways

Queue is an abstract data structure similar to Stacks. 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). For implementing queue using stack, one method is to make dequeue costly and other is to make enqueue costly

Kavita Bisht
OpenGenus IQ © 2025 All rights reserved â„¢
Contact - Email: team@opengenus.org
Primary Address: JR Shinjuku Miraina Tower, Tokyo, Shinjuku 160-0022, JP
Office #2: Commercial Complex D4, Delhi, Delhi 110017, IN
Top Posts LinkedIn Twitter
Android App
Apply for Internship