https://github.com/microsoft/ALEX
Of course they call it "ML", but it's just a linear interpolation for faster tree search.
11–20 of 27 posts
https://github.com/microsoft/ALEX
Of course they call it "ML", but it's just a linear interpolation for faster tree search.
As a side note, if you have the possibility to sort data before searching values in it then implement trie: https://en.wikipedia.org/wiki/Trie This is the best for data with very few updates/modifications and a lot of queries. One example would be points of interest on a map, like restaurants on google maps. Not like those restaurants gets updated/modified every single day but you do have clients that while using you…
Using this approach for a typo-tolerant instant search engine that I am working on: https://github.com/typesense/typesense
As Lemire says the problem (a good "problem"!) is that hashtables and B-trees can be quite fast, robust against different distributions, and you have them right at hand. It'd almost have to be some weird situation like you're handed data in a format that kinda fits the requirements and you're looking for how to work with it in-place.
Earlier quoted context omitted.
That's actually quite clever. I like it. I can't figure out the puzzle's answer. Hopefully they'll post the solution someday.
Yup that was the answer :-) interleaving the two lets you get the best of both worlds at the cost of a constant-factor penalty. This is a pretty clever & general-purpose meta-algorithm that works for pretty much any problem where you have competing algorithms with different strengths. Quitting and starting over as GGP mentioned is another option that also works for this problem, though it might not work as well for o…
>This being said, I am not aware of interpolation search being actually used productively in software today. If you have a reference to such an artefact, please share!
This is also my response to that note in the article, interpolation search has been well-known in the numerical methods world since ancient times. ;)
Earlier quoted context omitted.
Is the trick quit and start doing a binary search?
Ooh, or what about alternating interpolation and binary search steps? Interpolation steps make quick progress if your distribution is correct.
The element in the middle of the array is tested every single time. Similarly, the elements at 25% and 75% of the array are tested very often, in 50% searches/each.
Modern computers have very slow memory compared to computation speed, and multi-level caches to compensate. Binary search RAM access pattern, when done many times, is friendly towards these multi-level caches. The elements at positions like 25%, 50%, 75% will stay in L1D cache.
As a side note, if you have the possibility to sort data before searching values in it then implement trie: https://en.wikipedia.org/wiki/Trie This is the best for data with very few updates/modifications and a lot of queries. One example would be points of interest on a map, like restaurants on google maps. Not like those restaurants gets updated/modified every single day but you do have clients that while using you…
The mention of log(log(N)) reminded me of something entertaining I once heard from an algorithms professor: "log(log(N)) is less than 10".