[R] findInterval(), binary search, log(N) complexity

2008-09-22 Thread Markus Loecher
Dear R users, the help for findInterval(x,vec) suggests a logarithmic dependence on N (=length(vec)), which would imply a binary search type algorithm. However, when I test this hypothesis, in the following manner: set.seed(-3645); l - vector(); N.seq - c(5000, 50, 100, 1000,

Re: [R] findInterval(), binary search, log(N) complexity

2008-09-22 Thread Duncan Murdoch
On 9/22/2008 1:51 PM, Markus Loecher wrote: Dear R users, the help for findInterval(x,vec) suggests a logarithmic dependence on N (=length(vec)), which would imply a binary search type algorithm. However, when I test this hypothesis, in the following manner: R is open source. Why test things