Thanks very much for your responses. :) 'subseq' looks like it will do
what's needed.
-- Harmon
On Monday, May 25, 2020 at 4:47:58 PM UTC-5, Harmon Nine wrote:
>
> Is there an optimization for sorted-maps that, when you have a given key
> in the map, you can get the next key in O(log n) time?
>
Don't forget about subseq and rsubseq, the technology behind [the world's
smallest time series database](
https://www.dotkam.com/2015/12/02/time-series-database-in-one-line-of-clojure/)
;)
On Monday, May 25, 2020 at 4:47:58 PM UTC-5, Harmon Nine wrote:
>
> Is there an optimization for sorted-ma
Hey Harmon,
On Tue, May 26 2020, Harmon Nine wrote:
> Does such an optimization exist? If not, is there an means of getting the
> next-key in a sorted-map given a current-key that is better than O(n)?
I just had a look at clojure.core and found that subseq operates on a
sorted collection. Based
Hi, there is no such optimization and that's not really feasible in the
sorted-map impl. However there are other sorted map data structures like
https://github.com/clojure/data.avl which have facilities in this area.
On Monday, May 25, 2020 at 4:47:58 PM UTC-5, Harmon Nine wrote:
>
> Is there an
Is there an optimization for sorted-maps that, when you have a given key in
the map, you can get the next key in O(log n) time?
Given "compare" is the boolean function on which the sorted-map is based,
the following code will get the next-key given a current-key:
(defn get-next-key [my-map curr