Can you give me an hint how to develop an algorithm as this task? Everytime if I am reading something like this I don't know how to develop with using the run time. Thanks!
Give an algorithm that determines whether or not a given undirected graph G = (V;E) contains a cycle. Your algorithm should run in O(|V|) time, independent of |E|.