Worked on AdjencyListUndirected graph.