Uniform binary search: Difference between revisions

Content deleted Content added
L d allan (talk | contribs)
Added main to show how to invoke, and tidied up if statements
L d allan (talk | contribs)
Line 73:
The <code>make_delta</code> function initializes the array <code>delta</code> with successive halvings of <code>N</code>, rounded up; for example, if <code>N=40</code>, then <code>delta</code> will be initialized to {20, 10, 5, 3, 1, 1, 0}.
 
--[[User:L d allan|Lynn]] 07:52, 24 June 2006 (UTC) Note that this code has a tough time with arrays that have an even number of elements ... I found you need to put 'sentinel' entries that are max-value at the end. I suspect the code wasn't translated quite right from the original MIX code in Dr. Knuth's book.
--[[User:L d allan|Lynn]] 07:52, 24 June 2006 (UTC)
 
==References==