You need to pass low and high in, as the first code sample you posted did. Let's say you have a 100 element array and you're at the 2nd level of recursion, say examining the elements 50-75. The bs function is going to need 50 and 75 as inputs. On the other hand, it's not going to need n, except at the top level where low=0 and high=100.