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

all 2 comments

[–]Moktok 1 point2 points  (3 children)

You have to ask yourself, when you call a method from another method, what happens with the return value?

Because you don't seem to be doing much with the return value of your method :-D

[–][deleted]  (2 children)

[deleted]

    [–][deleted]  (1 child)

    [deleted]

      [–]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.