Skip to content
Prev 361484 / 398502 Next

detecting if a variable has changed

This help thread suggested a question to me:

Is there a function in some package that efficiently (I.e. O(log(n)) )
inserts a single new element into the correct location in an
already-sorted vector? My assumption here is that doing it via sort()
is inefficient, but maybe that is incorrect. Please correct me if so.

I realize that it would be straightforward to write such a function,
but I just wondered if it already exists. My google & rseek searches
did not succeed, but maybe I used the wrong keywords.

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Sun, Jun 5, 2016 at 9:47 AM, William Dunlap via R-help
<r-help at r-project.org> wrote: