{ "champ", "champion", "java" }
therefore the first binary search will return 1
The second search will return the appropriate index for word "You", if it would be inserted in this array and keeping it sorted.
Since upperCase letters are smaller than lowercase letters, then the appropriate insertion for word "You" in the array would be before the word "java" at index 0.The appropriate index for word "You" is calculated as (-insertion index - 1)
which gives us -1 as a result
|
Oracle Certified Professional Java Programmer
Author:
JavaChamp TeamSenior Java Developer
QuizOver.com
Germany
Access: |