๐ŸŽ New User? Get 20% off your first purchase with code NEWUSER20 ยท โšก Instant download ยท ๐Ÿ”’ Secure checkout Register Now โ†’
Menu

Categories

Programming Concepts Beginner

What is Stack?

A data structure that follows Last-In-First-Out (LIFO) ordering, where elements are added and removed from the same end (top).

Stacks support push (add to top) and pop (remove from top) operations, both in O(1). The call stack tracks function calls and local variables. Stacks are used in undo operations, expression evaluation, backtracking algorithms, and depth-first search.

The function call stack is fundamental to how programs execute โ€” each function call pushes a stack frame, and returning pops it. Stack overflow occurs when the stack exceeds its memory limit, typically from infinite recursion.

Related Terms

Singleton Pattern
A design pattern that restricts a class to a single instance and provides a global point of access to that instance.
Binary Search
An efficient search algorithm that finds a target value in a sorted array by repeatedly dividing the search interval in half.
Event-Driven Architecture
A software design pattern where components communicate by producing and consuming events rather than direct method calls.
Design Pattern
A reusable solution template for commonly occurring problems in software design.
Refactoring
Restructuring existing code without changing its external behavior to improve readability, maintainability, and performance.
Garbage Collection
An automatic memory management process that identifies and reclaims memory no longer in use by a program.
View All Programming Concepts Terms โ†’