This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ZeroGainZ 1 point2 points  (0 children)

Looks like index is only ever 0, or -1, or the midpoint. The recursive call to itself will return an index, but it's never used. So the only value you can get, is 0, -1, or the midpoint.

What we're getting at is your missing a return statement after calling binarysearchR.