Infosys interview question

tree, Graph and Strings related