Design a linear-time (O(|V | + |E|)) algorithm which, given anundirected graph G and a particular edge e in it, determineswhether G has a cycle containing e. (Design the algorithm, justifyits correctness and justify its runtime.)