Jump to content

Talk:Uniform binary search

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Quuxplusone (talk | contribs) at 06:35, 27 September 2006 (C implementation: new version posted with testing). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

C implementation

[redacted wrong code; see page history for details --Quuxplusone 06:35, 27 September 2006 (UTC)][reply]

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.

You are absolutely right. I can't believe I didn't test that code thoroughly before adding it. Apologies. A corrected and tested version has been posted now. (And with a main that shows the proper usage, unlike that cruft someone else put up without testing either. Hey, at least I don't make mistakes like "void main"! I make big complicated mistakes! :) --Quuxplusone 06:35, 27 September 2006 (UTC)[reply]