IBM Interview Question

Data Structures and Algorithm based question