<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 27, 2014 at 2:27 PM, Joe Armstrong <span dir="ltr"><<a href="mailto:erlang@gmail.com" target="_blank">erlang@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>Seems to work - so to find the K nearest I just iterate prev and next keeping track of</div><div>which direction I have to move - very nice.</div>

</blockquote></div><br>Yes. Coincidentally, this is also the approach taken by the fastest knapsack solver in existence, together with a dynamic programming table. But I digress :)<br><br clear="all"><div><br></div>-- <br>

J.
</div></div>