Skip to content

Instantly share code, notes, and snippets.

@take-five
Last active August 29, 2015 14:16
Show Gist options
  • Save take-five/512cb30363caff6b4508 to your computer and use it in GitHub Desktop.
Save take-five/512cb30363caff6b4508 to your computer and use it in GitHub Desktop.
readability test
def f(q,n)
if(n==nil)
return null;
end
l=0; h=ln(q)-1;d=l<=h;
while d
x=(l+h)/2;v=q[x]
if v>n then h=x-1
elsif v<n then l=x+1
else return v
end
d=l<=h;
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment