Characterizations of certain classes of graphs