Re: binary search with reference to append
- Posted by jimcbrown (admin) Jun 13, 2014
- 1941 views
jaygade said...
hi = (lo > hi && N) ? N : hi -- hi could be > N
Wait -- did Euphoria get a ternary operator when I wasn't looking? I just did a search and I couldn't find anything on it. Jim seems to be the search master, however.
Nope, we don't. That's probably meant to be the abridged version of this code:
if lo > hi and length(haystack) > 0 then hi = length(haystack) end if