Arrays
- Definition: A collection of elements stored at contiguous memory locations.
- Operations: Traversal, Insertion, Deletion, Searching, Sorting.
- Common Problems: Two Sum, Kadane's Algorithm, Maximum Subarray.
Strings
- Definition: A sequence of characters.
- Operations: Concatenation, Comparison, Searching, Manipulation.
- Common Problems: Longest Substring Without Repeating Characters, Anagram Check.
Linked List
- Definition: A linear data structure where elements are stored in nodes with pointers.
- Types: Singly, Doubly, Circular.
- Common Problems: Reverse Linked List, Detect Cycle, Merge Sorted Lists.
Stacks & Queues
- Stack: LIFO structure. Use cases include function calls, expression evaluation.
- Queue: FIFO structure. Used in scheduling, BFS.
- Common Problems: Valid Parentheses, Min Stack, Circular Queue.
Binary Search
- Used for searching in a sorted array with O(log n) time.
- Common Problems: Binary Search, Search in Rotated Array, Find Peak Element.
Trees
- Definition: Hierarchical data structure with nodes.
- Types: Binary Tree, BST, AVL, etc.
- Common Problems: Inorder Traversal, Max Depth, LCA, Diameter of Tree.
Graphs
- Definition: Set of nodes connected by edges.
- Representations: Adjacency Matrix/List.
- Algorithms: BFS, DFS, Dijkstra, Union-Find, Topological Sort.
Heaps
- Definition: Binary tree based data structure that satisfies the heap property.
- Types: Min-Heap, Max-Heap.
- Common Problems: Kth Largest Element, Merge K Sorted Lists.
Dynamic Programming
- Concept: Break problems into subproblems, solve each once, store the result.
- Approaches: Top-Down (Memoization), Bottom-Up (Tabulation).
- Common Problems: Climb Stairs, LCS, Coin Change, 0/1 Knapsack.
Greedy
- Concept: Make the locally optimal choice at each stage.
- Common Problems: Activity Selection, Gas Station, Jump Game.
Backtracking
- Concept: Try all possible solutions and backtrack upon failure.
- Common Problems: N-Queens, Sudoku Solver, Subset Generation.