Cognizant interview question

Basic Questions about tree and graph