Exercise3-1. binsearch alternative