<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: insertionsort code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sat, 26 Jul 2008 12:37:27 GMT</pubDate>
    <description>DZone Snippets: insertionsort code</description>
    <item>
      <title>C - Insertion sort</title>
      <link>http://snippets.dzone.com/posts/show/3972</link>
      <description>Classic implementation of the Insertion Sort algorithm.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;void isort_c(unsigned *a, int n) {&lt;br /&gt;  int k;&lt;br /&gt;  for (k = 1; k &lt; n; ++k) {&lt;br /&gt;    int key = a[k];&lt;br /&gt;    int i = k - 1;&lt;br /&gt;    while ((i &gt;= 0) &amp;&amp; (key &lt; a[i])) {&lt;br /&gt;      a[i + 1] = a[i];&lt;br /&gt;      --i;&lt;br /&gt;    }&lt;br /&gt;    a[i + 1] = key;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 09 May 2007 08:32:32 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3972</guid>
      <author>scvalex (Alexandru Scvortov)</author>
    </item>
  </channel>
</rss>
