Quote:
Determine whether the graph is a tree or not
Well use the basic hint to see whether a graph is a tree or not; a tree is a graph that doesn't allow going from a child node to a parent node.
I can also give you a hint, that the space complexity of this
could be O(N) since you need to know if you are ever visiting a parent node.
Good luck!
Quote:
if the graph is a cyclic graph (Contains Cycles) which contains a path from at least one node back to itself
Read the 2 paragraphs above and you will be able to understand what I mean.