Exercise for learning Data Structures and Algorithm Analysis