Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: Using Java Classes to Sort a Small Array Quickly Date: Sat, 17 Sep 2011 11:05:49 -0400 Organization: A noiseless patient Spider Lines: 27 Message-ID: References: <86c4a53b-1ca1-48a8-b954-c01bd449278a@s35g2000prm.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 17 Sep 2011 15:05:54 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="f8igmItKsWs6nM5YanFxAA"; logging-data="9490"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX183kiFdtrz5thIZ7dJLxP52" User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2 In-Reply-To: Cancel-Lock: sha1:FdF+pjjzK8MysgB3E0wIyCUB8O8= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8106 On 9/17/2011 10:52 AM, Wanja Gayk wrote: > In article, esosman@ieee-dot-org.invalid > says... > >>> Those constraints would be pretty useless though. On the other hand: >>> Sorting numbers of a limited range is pretty common. >>> Either way I would argue that sorting an empty or one-element array is >>> no sorting at all. >> >> Fine. Then sort >> >> data = new int[] { Integer.MAX_VALUE, 1, 3, 1, 4, 1, 5, 9 }; > > You don't get it, do you? > Which part of "limited range" was too hard to understand for you? My apologies. I should have asked you to sort new int[] { Integer.MAX_VALUE, Integer.MAX_VALUE - 1, }; ... an array whose range spans only two values. -- Eric Sosman esosman@ieee-dot-org.invalid