🎁 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

Garbage Collection
An automatic memory management process that identifies and reclaims memory no longer in use by a program.
Clean Code
Code that is easy to read, understand, and maintain — following consistent conventions, meaningful naming, and single-responsibility functions.
Version Control
A system that records changes to files over time, allowing you to recall specific versions, collaborate, and track history.
Linked List
A linear data structure where elements are stored in nodes, each containing data and a pointer to the next node in the sequence.
DRY (Don't Repeat Yourself)
A software development principle that aims to reduce code duplication by abstracting common patterns into reusable components.
Regex (Regular Expression)
A sequence of characters that defines a search pattern, used for string matching, validation, and text manipulation.
View All Programming Concepts Terms →