Data Structures
Learn data structures with definitions, syntax, and practical examples. Essential for coding interviews and algorithm design.
Basic Data Structures
Array
Fixed-size collection of elements with contiguous memory allocation.
Linked List
Linear data structure with nodes connected by pointers.
Stack
LIFO (Last In, First Out) data structure with push and pop operations.
Queue
FIFO (First In, First Out) data structure with enqueue and dequeue operations.
Hash Table
Key-value pairs with O(1) average time complexity for operations.
Tree
Hierarchical data structure with nodes and edges, no cycles.
Advanced Data Structures
Binary Search Tree
Binary tree with left child < parent < right child property.
Heap
Complete binary tree with heap property (min or max heap).
Graph
Vertices and edges, can be directed or undirected, weighted or unweighted.
Trie
Tree-like data structure for storing strings, efficient for prefix searches.
Segment Tree
Tree data structure for range queries and updates in O(log n).
Fenwick Tree
Binary Indexed Tree for efficient prefix sum queries and updates.
Sorting Algorithms
Quick Sort
Divide and conquer algorithm with O(n log n) average case.
Merge Sort
Stable sorting algorithm with guaranteed O(n log n) time complexity.
Heap Sort
In-place sorting using heap data structure, O(n log n) time complexity.
Bubble Sort
Simple comparison-based algorithm, O(n²) time complexity.
Insertion Sort
Efficient for small datasets, O(n²) worst case, O(n) best case.
Selection Sort
Finds minimum element and swaps, O(n²) time complexity.