๐ŸŽ 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

Debugging
The process of finding and fixing errors (bugs) in software code to ensure correct program behavior.
Closure
A function that captures and retains access to variables from its enclosing scope, even after that scope has finished executing.
Observer Pattern
A design pattern where an object (subject) maintains a list of dependents (observers) that are notified automatically of state changes.
Version Control
A system that records changes to files over time, allowing you to recall specific versions, collaborate, and track history.
DRY (Don't Repeat Yourself)
A software development principle that aims to reduce code duplication by abstracting common patterns into reusable components.
API Design
The practice of designing application programming interfaces that are consistent, intuitive, and maintainable for developers to consume.
View All Programming Concepts Terms โ†’