Infosys interview question

introduction, data structures and algorithms question