Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 4
    searchsorted isn't nlog(n) since it doesn't sort the array before searching, it assumes that the argument array is already sorted. check out the documentation of numpy.searchsorted (link above) Commented Aug 7, 2018 at 16:31
  • It's mlog(n): m binary searches inside a list of length n. Commented Apr 26, 2021 at 10:32
  • 1
    Its mlog(n) if m elements are to be searched, when a m shaped array is passed instead of a single element like 3. It is log(n) for this question's requirement which is about finding one element. Commented May 17, 2021 at 10:13