Linked List
Definition
A linear data structure where each element (node) contains a value and a pointer to the next node. Unlike arrays, linked lists don't require contiguous memory and allow O(1) insertions at the head, but have O(n) random access.
Code Example
Learn More
Related Terms
A mathematical notation that describes the upper bound of an algorithm's time or space complexity as input size grows. Common complexities from fastest to slowest: O(1), O(log n), O(n), O(n log n), O(n^2), O(2^n).
StackA Last-In-First-Out (LIFO) data structure where elements are added and removed from the same end (the top). The JavaScript call stack is a stack. Common operations: push (add to top), pop (remove from top), peek (view top).
QueueA First-In-First-Out (FIFO) data structure where elements are added at the back and removed from the front. Used in BFS, task scheduling, and message queues. Common operations: enqueue (add), dequeue (remove), peek (view front).