1. Write an algorithm to determine whether an undirected graph of |V| vertices contains a cycle. Your algorithm should run in Θ(|V|) time.
2. The single-destination shortest-paths problem for a directed graph is to find the shortest path from every vertex to a specified vertex V. Write an algorithm to solve the single-destination shortest-paths problem.