|
|
|
|
|
by mehrdadn
2030 days ago
|
|
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 other problems where you can't put a nice bound on the number of steps. FWIW there's also a very dumb (or smart I guess, depending on your point of view) solution, which is to just have 2 threads run simultaneously, and report the result of the first one. It might make sense for some problems. And in any case, this is basically equivalent to what you're doing on 1 CPU with the previous technique. |
|
>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. ;)