Since we're looking at every vertex's edges, the total time should be O(V+E).
Since we're looking at every vertex's edges, the total time should be O(V+E).