2009/12/31 Rob Lachlan <[email protected]>: > About a year and a half ago, there was some discussion about having a > function that would enable some kind of bounded search on a sorted > Does this exist, currently? I haven't looked at the gory details of
subseq and rsubseq provide efficient bounded searching. I don't see the need for find or seek as that is really just (first (subseq sm)) For your particular problem (find closest) a combination of first subseq >= and first rsubseq <= will find you the two best candidates on either side, and thus which is closest. However this is slightly more work than if you could just do one efficient search and then access the key to the other side of the test... which is a different proposition all together than bounded search but if it is useful sounds easy enough to expose. Currently you can access the tree itself (.tree sm) works, but you can't find out what's to the left or right because those are private. Do you want to navigate the tree, or would a left and right search suffice? Regards, Tim. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
