<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Sorting in Linear time</title>
	<atom:link href="http://elliottback.com/wp/sorting-in-linear-time/feed/" rel="self" type="application/rss+xml" />
	<link>http://elliottback.com/wp/sorting-in-linear-time/</link>
	<description>Internet &#38; Technology</description>
	<lastBuildDate>Sun, 22 Nov 2009 02:40:56 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Elliott Back</title>
		<link>http://elliottback.com/wp/sorting-in-linear-time/#comment-2091620</link>
		<dc:creator>Elliott Back</dc:creator>
		<pubDate>Wed, 24 Sep 2008 23:04:25 +0000</pubDate>
		<guid isPermaLink="false">http://elliottback.com/wp/?p=1198#comment-2091620</guid>
		<description>I totally agree with you!</description>
		<content:encoded><![CDATA[<p>I totally agree with you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrasek</title>
		<link>http://elliottback.com/wp/sorting-in-linear-time/#comment-2090927</link>
		<dc:creator>Andrasek</dc:creator>
		<pubDate>Wed, 24 Sep 2008 17:38:43 +0000</pubDate>
		<guid isPermaLink="false">http://elliottback.com/wp/?p=1198#comment-2090927</guid>
		<description>I feel like I should mention that you&#039;ll never be able to write an algorithm *in Java* that is faster than the in-built .sort() algorithm.  The reason for this is due to the overhead from using arrays in Java.

For example, it&#039;s not possible for an array to have a subscript that is beyond the bounds of the array.  For example, you can&#039;t have a 100 element array and then reference cell 105.  Java throws an error.  

This simple range checking functionality on every single instance of referencing an array causes a noticeable amount of overhead.  Imagine putting an &quot;if&quot; check before every array subscript usage.  I count 24 array subscripts in the PartialFlashSort algorithm alone.  That&#039;s 24 extra checks your code performs that the in-built .sort() routine can ignore.

Also, the inbuilt .sort() algorithm uses a &quot;tuned quicksort&quot; which performs significantly better than the standard quicksort on several troublesome data sets.  Trying to beat a quicksort is a challenge in itself.  If you add to that the additional overhead that the Java language adds, there&#039;s no chance that any Java-based sorting algorithm can compete with the internal Java .sort() routine.</description>
		<content:encoded><![CDATA[<p>I feel like I should mention that you&#8217;ll never be able to write an algorithm *in Java* that is faster than the in-built .sort() algorithm.  The reason for this is due to the overhead from using arrays in Java.</p>
<p>For example, it&#8217;s not possible for an array to have a subscript that is beyond the bounds of the array.  For example, you can&#8217;t have a 100 element array and then reference cell 105.  Java throws an error.  </p>
<p>This simple range checking functionality on every single instance of referencing an array causes a noticeable amount of overhead.  Imagine putting an &#8220;if&#8221; check before every array subscript usage.  I count 24 array subscripts in the PartialFlashSort algorithm alone.  That&#8217;s 24 extra checks your code performs that the in-built .sort() routine can ignore.</p>
<p>Also, the inbuilt .sort() algorithm uses a &#8220;tuned quicksort&#8221; which performs significantly better than the standard quicksort on several troublesome data sets.  Trying to beat a quicksort is a challenge in itself.  If you add to that the additional overhead that the Java language adds, there&#8217;s no chance that any Java-based sorting algorithm can compete with the internal Java .sort() routine.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic page generated in 0.296 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2009-11-22 03:48:00 -->
<!-- Compression = gzip -->