Amazon Interview Question

Given a graph find if it is a tree