Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Gene Wirchenko Newsgroups: comp.lang.java.programmer Subject: Re: Using Java Classes to Sort a Small Array Quickly Date: Mon, 12 Sep 2011 10:57:30 -0700 Organization: A noiseless patient Spider Lines: 22 Message-ID: References: <86c4a53b-1ca1-48a8-b954-c01bd449278a@s35g2000prm.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: mx04.eternal-september.org; posting-host="7Qrvczazr82YckO5XW8Vtw"; logging-data="7115"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/lLl6wAC+hsLjVdZFKu9tocz6tr417ceA=" X-Newsreader: Forte Agent 4.2/32.1118 Cancel-Lock: sha1:5IdpzQHPsXfpa/yYVNVeduhZSgk= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7908 On Mon, 12 Sep 2011 01:40:50 +0200, Wanja Gayk wrote: >In article , esosman@ieee-dot-org.invalid >says... > >> Very nice! Would you care to try this approach on a shorter >> input array, like >> >> data = new int[] { Integer.MAX_VALUE }; >> >> This case should be quite simple, since the array is already sorted. >> Let us know how you make out, will you? > >I didn't say it works for any array out there, did I? You did. Claiming an algorithm is O(n) means claiming that that is the upper bound. Sincerely, Gene Wirchenko