I\'ve been getting strange compiler errors on this binary search algorithm. I get a warning that control reaches end of non-void function. What does this mean?<
The compiler isn't smart enough to know that <, >, and == are a "complete set". You can let it know that by removing the condition "if(val == sorted[mid])" -- it's redundant. Jut say "else return mid;"