Path: csiph.com!news.mixmin.net!border2.nntp.ams1.giganews.com!nntp.giganews.com!buffer2.nntp.ams1.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail NNTP-Posting-Date: Thu, 15 Jun 2017 14:17:01 -0500 From: Gareth Owen Newsgroups: comp.lang.c Subject: Re: Algorithm/code to compare values in an array References: Date: Thu, 15 Jun 2017 20:17:01 +0100 Message-ID: <87lgotcb82.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:YwD1tvpLxXYKMlWu1eIhvyA0bsk= MIME-Version: 1.0 Content-Type: text/plain Lines: 6 X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-u2qOtZU5oFlPVs2mREeWzZkP6X5k207Rjwr8rD+uPm5kyHSSB1jCv1/LC0ungbaVvAdjHwkfNQIu8CV!EammFj7Df5PVHQpWd3FYXDw+vC1vITc/VusWPFZnhGjZMUBrdDpHKoXhAxq/l3E3Caxbteg= X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1292 Xref: csiph.com comp.lang.c:112284 Richard Heathfield writes: > If either of those is likely, switching from an O(n) to an O(log n) > approach is something you might want to consider. Assuming the arrays are guaranteed to be sorted, yes? (Or am I being obtuse)