Showing 20 of 20 questions
Easy: 0
Medium: 0
Hard: 0
Overview
Graphs are versatile data structures used to model relationships and networks. This section covers graph representation, traversal, and advanced algorithms.
Key Concepts
- Graph representation (adjacency list, matrix)
- Depth-first search (DFS)
- Breadth-first search (BFS)
- Shortest path algorithms (Dijkstra, Bellman-Ford)
- Topological sorting
- Union-find (disjoint set)
Common Problems
Easy
- Find if Path Exists in Graph
- Number of Islands
- Clone Graph
- Course Schedule
Medium
- Number of Connected Components
- Pacific Atlantic Water Flow
- Word Ladder
- Network Delay Time
Hard
- Word Ladder II
- Alien Dictionary
- Critical Connections in a Network
Practice Tips
- Choose traversal wisely: DFS for paths, BFS for shortest paths
- Track visited nodes: Prevent infinite loops
- Graph representation: Choose based on density
- Time complexity: Consider V (vertices) and E (edges)