Traversal demonstration of undirected graphs (two traversal methods)