Methods guessEqualsItem, guessGreaterThanItem, and guessLessThanItem from java examples of chapter 1 binary search check the contrary condition of their names, this might sound weird.
Example of suggestion:
Instead of
public static boolean guessGreaterThanItem(int guess, int item) { if (guess < item) { return false; } return true; }
Do
public static boolean guessGreaterThanItem(int guess, int item) { if (guess > item) { return true; } return false; }
If you grant me permission I will open the Merge Request for the improvment.
Methods guessEqualsItem, guessGreaterThanItem, and guessLessThanItem from java examples of chapter 1 binary search check the contrary condition of their names, this might sound weird.
Example of suggestion:
Instead of
public static boolean guessGreaterThanItem(int guess, int item) { if (guess < item) { return false; } return true; }
Do
public static boolean guessGreaterThanItem(int guess, int item) { if (guess > item) { return true; } return false; }