title: Why does the time complexity of DFS and BFS depend on the way the graph is represented?
body: <p>The site <a href="http://web.eecs.utk.edu/~huangj/CS302S04/notes/graph-searching.html" rel="noreferrer">http://web.eecs.utk.edu/~huangj/CS302S04/notes/graph-searching.html</a> describes that when an adjacency list is used then, DFS and BFS have complexity O(V+E), and if an adjacency matrix is used, the complexity is O(V<sup>2</sup>). Why is this?</p>