← Study

DSA Fundamentals

The theory behind the 150 problems — what each structure actually is, why it behaves the way it does, and where interviewers dig deeper.

This is concept-first: one topic, one page, with intuition, a worked example and a runnable demo. For solved problems, see DSA — 150 Questions.
Foundations
Intro to DSA & Complexity Analysis
What a data structure actually is, Big-O/Ω/Θ, space complexity, and why "efficient" has three different meanings.
Arrays
Contiguous memory, O(1) access, and why insertion/deletion cost what they cost.
Linked Lists
Singly, doubly and circular lists, and the pointer surgery behind insert/delete/reverse.
Algorithms
Searching
Linear vs binary search, and binary search on the answer space.
Sorting Algorithms
Bubble, selection, insertion, merge, quick, counting and radix sort — and why you'd pick one over another.
Linear Structures
Stacks
LIFO, infix/postfix/prefix, expression evaluation, and the Next Greater Element pattern.
Queues
FIFO, circular queues, priority queues, deques, and implementing one structure with the other.
Trees & Priority Structures
Trees & Binary Search Trees
Terminology, the BST invariant, all three traversal orders, height, diameter and LCA.
Heaps
Min/max heaps, heapify, priority queues, and how heap sort falls out of the same idea.
Hashing & Graphs
Hash Tables
Hash functions, collisions, chaining vs open addressing, and why "average O(1)" isn't a guarantee.
Graphs
Adjacency list vs matrix, BFS vs DFS, cycle detection, topological sort, and shortest-path basics.