Cognizant interview question

DFS, Array of objects, Graph and MF