IBM interview question

Data Structures and Algorithm based question