<?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>Swarling Black Mable &#187; Algorithms</title>
	<atom:link href="http://blainegarrett.com/category/programming/algorithms/feed/" rel="self" type="application/rss+xml" />
	<link>http://blainegarrett.com</link>
	<description>Blaine Garrett's Home on the Web - Art, Programming, Ideas, and more</description>
	<lastBuildDate>Tue, 02 Aug 2011 18:50:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Insertion Sort In PHP</title>
		<link>http://blainegarrett.com/2008/05/30/insertion-sort-in-php/</link>
		<comments>http://blainegarrett.com/2008/05/30/insertion-sort-in-php/#comments</comments>
		<pubDate>Fri, 30 May 2008 16:11:00 +0000</pubDate>
		<dc:creator>blainegarrett</dc:creator>
				<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://blainegarrett.com/blog/?p=262</guid>
		<description><![CDATA[Insertion Sort In PHP function insertion_sort4 ($a) { for ($i = 1; $i &#38;lt; count($a); ++$i) { /* Assume items before a[i] are sorted. */ /* Pick an number */ $key = $a[$i]; /* Do binary search to find out the point where b is inserted. */ $low = 0; //left $high = $i; //right [...]]]></description>
			<content:encoded><![CDATA[<p>Insertion Sort In PHP</p>
<pre class="brush: php">
function insertion_sort4 ($a) {
    for ($i = 1; $i &amp;lt; count($a); ++$i) {
        /* Assume items before a[i] are sorted. */
        /* Pick an number */
        $key = $a[$i];
        /* Do binary search to find out the point where b is inserted. */
        $low = 0; //left
        $high = $i; //right
        $k = 0;

	    while ($low - $high = $a[$j]) {
	            $low = $j + 1;
            }
	        else {
	            $high = $j;
            }
        }

	/* Shift items between high and i by 1 */
	    for ($k = $i; $k &amp;gt; $low; $k--) {
	        $a[$k] = $a[$k - 1];
        }
    	$a[$low] = $key;
	}
    return $a;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blainegarrett.com/2008/05/30/insertion-sort-in-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

