Question in Cracking_the_coding_interview by java