IBM interview question

Two coding question base on Data Structures and Algorithms