<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>A Party to the World &#187; heapsort</title>
	<atom:link href="http://dan.lecocq.us/wordpress/tag/heapsort/feed/" rel="self" type="application/rss+xml" />
	<link>http://dan.lecocq.us/wordpress</link>
	<description>Life, love, and computer science</description>
	<lastBuildDate>Fri, 06 Jan 2012 17:21:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Heapsort</title>
		<link>http://dan.lecocq.us/wordpress/2008/06/24/heapsort/</link>
		<comments>http://dan.lecocq.us/wordpress/2008/06/24/heapsort/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 00:05:43 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[computer science]]></category>
		<category><![CDATA[math]]></category>
		<category><![CDATA[proofs]]></category>
		<category><![CDATA[complexity theory]]></category>
		<category><![CDATA[heapsort]]></category>
		<category><![CDATA[infinite series]]></category>
		<category><![CDATA[proof]]></category>

		<guid isPermaLink="false">http://dan.lecocq.us/wordpress/2008/06/24/heapsort/</guid>
		<description><![CDATA[I was reading about Algorithm Geeks, a Google Group dedicated to algorithm-related questions apparently. I looked at one of the topics, Unique Elements in an Array, wondering what the chatter looked like. To remove duplicate elements of an array, the best way I know is to sort your array, and then do a linear traversal, [...]]]></description>
			<content:encoded><![CDATA[<p>I was reading about <a href="http://groups.google.com/group/algogeeks">Algorithm Geeks</a>, a Google Group dedicated to algorithm-related questions apparently.  I looked at one of the topics, <a href="http://groups.google.com/group/algogeeks/web/unique-elements-in-an-array">Unique Elements in an Array</a>, wondering what the chatter looked like.</p>
<p>To remove duplicate elements of an array, the best way I know is to sort your array, and then do a linear traversal, comparing each to its successor, and when they match, deleting the one of them.  Quicksort is generally the algorithm-of-choice in large part because of its simplicity, but someone on this thread suggested <a href="http://en.wikipedia.org/wiki/Heapsort">heapsort</a> &#8211; an algorithm of which I had never heard.  I looked it over, and was drawn to the article on <a href="http://en.wikipedia.org/wiki/Binary_heap">heaps</a>.  On that page, I was looking at an analysis of the time complexity for building the heap, and I got curious about the summation they present (h/2^h).  So, I took some time and proved its convergence:</p>
<p><a href='http://dan.lecocq.us/wordpress/wp-content/uploads/2008/06/heap.pdf' title='Convergence of Infinite Sum'>Convergence of Infinite Sum</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dan.lecocq.us/wordpress/2008/06/24/heapsort/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

