Given the number of vertices **n** and a list of **edges**, build both representations of the graph:
- **Adjacency List**: an array where `list[i]` contains all neighbors of vertex i.
- **Adjacency Matrix**: an n×n 2D array where `matrix[i][j] = 1` if there is an edge between i and j, else 0.
Assume the graph is **undirected**.
Interactive graph explorer available!
Switch to the Visualize tab to build a custom graph and animate BFS traversal to test your intuition.