On Sat, Nov 7, 2015 at 4:34 PM, Milan Bouchet-Valat
wrote:
> Le samedi 07 novembre 2015 à 06:37 -0800, Michele Zaffalon a écrit :
> > What is the best way of telling whether an element `x` is present in
> > a sorted list `a`?
> >
> > Using `searchsortedlist`, I also need to check that the element
Le samedi 07 novembre 2015 à 06:37 -0800, Michele Zaffalon a écrit :
> What is the best way of telling whether an element `x` is present in
> a sorted list `a`?
>
> Using `searchsortedlist`, I also need to check that the element is
> present in the list. This is what I do
>
> function isinsortedl
What is the best way of telling whether an element `x` is present in a
sorted list `a`?
Using `searchsortedlist`, I also need to check that the element is present
in the list. This is what I do
function isinsortedlist(a, x)
n = searchsortedfirst(a, x)
n <= length(a) && a[n] == x
end
Sh