PageRenderTime 13ms CodeModel.GetById 10ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/www.cppreference.com/wiki/insertion_sort

https://github.com/tsgates/cclookup
#! | 48 lines | 46 code | 2 blank | 0 comment | 0 complexity | ef967b458e594450e22ae744ed2f95b5 MD5 | raw file
 1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
 4 lang="en" dir="ltr">
 5<head>
 6  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 7  <title>insertion_sort</title>
 8<meta name="generator" content="DokuWiki" />
 9<meta name="robots" content="index,follow" />
10<meta name="date" content="2010-10-28T18:17:27-0700" />
11<meta name="keywords" content="insertion_sort" />
12<link rel="search" type="application/opensearchdescription+xml" href="http://www.cppreference.com/wiki/lib/exe/opensearch.php" title="C++ Reference" />
13<link rel="start" href="../index.html" />
14<link rel="contents" href="http://www.cppreference.com/wiki/insertion_sort?do=index" title="Sitemap" />
15<link rel="alternate" type="application/rss+xml" title="Recent Changes" href="http://www.cppreference.com/wiki/feed.php" />
16<link rel="alternate" type="application/rss+xml" title="Current Namespace" href="http://www.cppreference.com/wiki/feed.php?mode=list&amp;ns=" />
17<link rel="alternate" type="text/html" title="Plain HTML" href="http://www.cppreference.com/wiki/_export/xhtml/insertion_sort" />
18<link rel="alternate" type="text/plain" title="Wiki Markup" href="http://www.cppreference.com/wiki/_export/raw/insertion_sort" />
19<link rel="canonical" href="insertion_sort" />
20<link rel="stylesheet" media="screen" type="text/css" href="lib/exe/css.php@t=custom1&amp;tseed=1289693594" />
21<link rel="stylesheet" media="all" type="text/css" href="lib/exe/css.php@s=all&amp;t=custom1&amp;tseed=1289693594" />
22<link rel="stylesheet" media="print" type="text/css" href="lib/exe/css.php@s=print&amp;t=custom1&amp;tseed=1289693594" />
23<script type="text/javascript" ><!--//--><![CDATA[//><!--
24var NS='';var JSINFO = {"id":"insertion_sort","namespace":""};
25//--><!]]></script>
26<script type="text/javascript" charset="utf-8" src="lib/exe/js.php@tseed=1289693594" ></script>
27</head>
28<body>
29<div class="dokuwiki export">
30
31<p>
321) start
332) input n,a[n]
343) for (i=1;i&lt;n;i++)
35</p>
36<pre class="code">   
37  element=a[i]
38    j=i-1
39 while(a[j]&gt;element or j&gt;0)
40  {
41    a[j+1]=a[j]
42     j=j-1
43  }
44   
45   </pre>
46</div>
47</body>
48</html>