Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Binary Search Date: Fri, 08 Apr 2011 00:01:44 -0400 Organization: albasani.net Lines: 15 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net kf7THbyZjZCKbl760JN1exGGLSFwXNcQir71pLgA16mj7MKCjUblC2aX+AJ3msvoXaG7BW9Aqqnpo4wsP5ll4Q== NNTP-Posting-Date: Fri, 8 Apr 2011 04:01:32 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="cpVGfY04Pl2f/cHg0p65LTE48PdedPX9Lre727QCXRpRmQsCNHHWOd2C9xCJo4iG6joosUyTy6iYpXZTyPdLrnL1PfAG2Fn84eS6ChvJkH0HrE7ULhfWISlNbUhZ33PU"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 In-Reply-To: Cancel-Lock: sha1:m47kivNOB8bSYuZYRqAo8Era0Pc= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:2974 On 04/07/2011 11:29 PM, Gene wrote: > This is wrong. It depends on how long comparisons take. If comparing two elements requires 1 minute, and the list has 20 elements, then the binary search runs in no more than 5 minutes plus a few microseconds, and the linear search runs in no more than 20 minutes plus a few microseconds. So you clearly want the binary search. What is wrong? Your message shows up with no context, disconnected from any thread, so it's impossible to know about what you speak. Please do not email Usenet posts to "comp.lang.java.programmer@googlegroups.com". It's nonsensical because Usenet forums are not part of Google Groups, and posting that way doesn't work very well. Do not set a separate "reply-to". Just post to the newsgroup. -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg