🎁 New User? Get 20% off your first purchase with code NEWUSER20 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

Recursion
A programming technique where a function calls itself to solve a problem by breaking it into smaller subproblems.
Unit Testing
Testing individual components or functions of a program in isolation to verify they work correctly.
Twelve-Factor App
A methodology of twelve best practices for building modern, scalable, maintainable software-as-a-service applications.
API Design
The practice of designing application programming interfaces that are consistent, intuitive, and maintainable for developers to consume.
Big O Notation
A mathematical notation that describes the worst-case performance of an algorithm as input size grows.
Hash Table
A data structure that maps keys to values using a hash function, providing average O(1) time complexity for lookups, insertions, and deletions.
View All Programming Concepts Terms →