It would be great if the binary search method return the index of the object in the array instead of the object itself. The index gives you more information (where it is instead of just whether or not it exists) and it's free-- you already have it when returning.
It would be great if the binary search method return the index of the object in the array instead of the object itself. The index gives you more information (where it is instead of just whether or not it exists) and it's free-- you already have it when returning.