<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Couldn&#8217;t come up with an appropriate title ;-)</title>
	<atom:link href="http://404blognotfound.wordpress.com/2008/02/29/couldnt-come-up-with-an-appropriate-title/feed/" rel="self" type="application/rss+xml" />
	<link>http://404blognotfound.wordpress.com/2008/02/29/couldnt-come-up-with-an-appropriate-title/</link>
	<description>Not just another WordPress.com weblog</description>
	<lastBuildDate>Thu, 19 Jun 2008 00:17:22 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Sreelu</title>
		<link>http://404blognotfound.wordpress.com/2008/02/29/couldnt-come-up-with-an-appropriate-title/#comment-78</link>
		<dc:creator>Sreelu</dc:creator>
		<pubDate>Thu, 20 Mar 2008 12:44:35 +0000</pubDate>
		<guid isPermaLink="false">http://404blognotfound.wordpress.com/2008/02/29/couldnt-come-up-with-an-appropriate-title/#comment-78</guid>
		<description>I could finally post the code.
the &lt;code&gt; tags are not working..
even after placing the code in &lt;code&gt; tags.. indentation is lost, greater than and lesser than symbols are getting messed up..

finally used &#160;, &lt;, &gt; entities to get the code correctly posted. Would like to know if there is a better way..</description>
		<content:encoded><![CDATA[<p>I could finally post the code.<br />
the &lt;code&gt; tags are not working..<br />
even after placing the code in &lt;code&gt; tags.. indentation is lost, greater than and lesser than symbols are getting messed up..</p>
<p>finally used &nbsp;, &lt;, &gt; entities to get the code correctly posted. Would like to know if there is a better way..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sreelu</title>
		<link>http://404blognotfound.wordpress.com/2008/02/29/couldnt-come-up-with-an-appropriate-title/#comment-39</link>
		<dc:creator>Sreelu</dc:creator>
		<pubDate>Mon, 03 Mar 2008 14:28:54 +0000</pubDate>
		<guid isPermaLink="false">http://404blognotfound.wordpress.com/2008/02/29/couldnt-come-up-with-an-appropriate-title/#comment-39</guid>
		<description>trying once more.. 

&lt;code&gt;
min = A[0]; //stores the min element found in the array so far
B[0] = -1;
index[0] = -1; /*for the elements being stored in B, their original indexes in A will be stored in index[n] array */

for ( i = 1; i &lt; n; i++) {
&#160;&#160;&#160;&#160;&#160;&#160;if (A[i] &lt; min) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;B[i] = -1;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;index[i] = -1;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;min = A[i];
&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;else if ( A[i-1] &lt; A[i] ) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;index[i] = i-1;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;B[i] = A[i-1];
&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;else {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;for (k = i-1; k &gt; 0; k = index[k] ) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if (B[k] &lt; A[i] ) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;index[i] = index[k];
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;B[i] = B[k];
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;break;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;}
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>trying once more.. </p>
<p><code><br />
min = A[0]; //stores the min element found in the array so far<br />
B[0] = -1;<br />
index[0] = -1; /*for the elements being stored in B, their original indexes in A will be stored in index[n] array */</p>
<p>for ( i = 1; i &lt; n; i++) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (A[i] &lt; min) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;B[i] = -1;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;index[i] = -1;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;min = A[i];<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else if ( A[i-1] &lt; A[i] ) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;index[i] = i-1;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;B[i] = A[i-1];<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (k = i-1; k &gt; 0; k = index[k] ) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (B[k] &lt; A[i] ) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;index[i] = index[k];<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;B[i] = B[k];<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sreelu</title>
		<link>http://404blognotfound.wordpress.com/2008/02/29/couldnt-come-up-with-an-appropriate-title/#comment-38</link>
		<dc:creator>Sreelu</dc:creator>
		<pubDate>Mon, 03 Mar 2008 14:26:13 +0000</pubDate>
		<guid isPermaLink="false">http://404blognotfound.wordpress.com/2008/02/29/couldnt-come-up-with-an-appropriate-title/#comment-38</guid>
		<description>hey there is some problem..  will send the code to naresh to post..</description>
		<content:encoded><![CDATA[<p>hey there is some problem..  will send the code to naresh to post..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sreelu</title>
		<link>http://404blognotfound.wordpress.com/2008/02/29/couldnt-come-up-with-an-appropriate-title/#comment-37</link>
		<dc:creator>Sreelu</dc:creator>
		<pubDate>Mon, 03 Mar 2008 14:24:20 +0000</pubDate>
		<guid isPermaLink="false">http://404blognotfound.wordpress.com/2008/02/29/couldnt-come-up-with-an-appropriate-title/#comment-37</guid>
		<description>oops! thats a mess.. some of the lines got deleted.. posting again..

min = A[0];
B[0] = -1;
index[0] = -1;

for ( i = 1; i &lt; n; i++) {
&#160;&#160;&#160;&#160;&#160; if (A[i] &lt; min) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; B[i] = -1;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; index[i] = -1;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; min = A[i];
&#160;&#160;&#160;&#160;&#160; }
&#160;&#160;&#160;&#160;&#160; else if ( A[i-1] &lt;A&gt; 0; k = index[k] ) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;  if (B[k] &lt; A[i] ) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;  index[i] = index[k];
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;  B[i] = B[k];
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;  break;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160; }
}</description>
		<content:encoded><![CDATA[<p>oops! thats a mess.. some of the lines got deleted.. posting again..</p>
<p>min = A[0];<br />
B[0] = -1;<br />
index[0] = -1;</p>
<p>for ( i = 1; i &lt; n; i++) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (A[i] &lt; min) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; B[i] = -1;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; index[i] = -1;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; min = A[i];<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else if ( A[i-1] <a> 0; k = index[k] ) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  if (B[k] &lt; A[i] ) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  index[i] = index[k];<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  B[i] = B[k];<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  break;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />
}</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: srawon</title>
		<link>http://404blognotfound.wordpress.com/2008/02/29/couldnt-come-up-with-an-appropriate-title/#comment-36</link>
		<dc:creator>srawon</dc:creator>
		<pubDate>Mon, 03 Mar 2008 12:28:22 +0000</pubDate>
		<guid isPermaLink="false">http://404blognotfound.wordpress.com/2008/02/29/couldnt-come-up-with-an-appropriate-title/#comment-36</guid>
		<description>i didn&#039;t get it.. esp the &quot;else if&quot; part.
can u pls repost ur code?</description>
		<content:encoded><![CDATA[<p>i didn&#8217;t get it.. esp the &#8220;else if&#8221; part.<br />
can u pls repost ur code?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sreelu</title>
		<link>http://404blognotfound.wordpress.com/2008/02/29/couldnt-come-up-with-an-appropriate-title/#comment-35</link>
		<dc:creator>Sreelu</dc:creator>
		<pubDate>Mon, 03 Mar 2008 10:30:44 +0000</pubDate>
		<guid isPermaLink="false">http://404blognotfound.wordpress.com/2008/02/29/couldnt-come-up-with-an-appropriate-title/#comment-35</guid>
		<description>If we can maintain another array which stores indexes of elements getting stored in B, we can keep checking B instead of A for finding the largest index such that B[k] &lt; A[i] 

min = A[0]; //stores the min element found in the array so far
B[0] = -1;
index[0] = -1; /*for the elements being stored in B, their original indexes in A will be stored in index[n] array */

for ( i = 1; i &lt; n; i++) {
&#160;&#160;&#160;&#160;&#160;&#160;if (A[i] &lt; min) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;B[i] = -1;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;index[i] = -1;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;min = A[i];
&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;else if ( A[i-1] &lt;A&gt; 0; k = index[k] ) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if (B[k] &lt; A[i] ) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;index[i] = index[k];
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;B[i] = B[k];
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;break;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;}
}</description>
		<content:encoded><![CDATA[<p>If we can maintain another array which stores indexes of elements getting stored in B, we can keep checking B instead of A for finding the largest index such that B[k] &lt; A[i] </p>
<p>min = A[0]; //stores the min element found in the array so far<br />
B[0] = -1;<br />
index[0] = -1; /*for the elements being stored in B, their original indexes in A will be stored in index[n] array */</p>
<p>for ( i = 1; i &lt; n; i++) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (A[i] &lt; min) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;B[i] = -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}</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sreelu</title>
		<link>http://404blognotfound.wordpress.com/2008/02/29/couldnt-come-up-with-an-appropriate-title/#comment-34</link>
		<dc:creator>Sreelu</dc:creator>
		<pubDate>Mon, 03 Mar 2008 08:27:45 +0000</pubDate>
		<guid isPermaLink="false">http://404blognotfound.wordpress.com/2008/02/29/couldnt-come-up-with-an-appropriate-title/#comment-34</guid>
		<description>Can we maintain another array of &#039;n&#039; elements in addition to arrays A and B? space used will be 3n which is still O(n).. is this ok?</description>
		<content:encoded><![CDATA[<p>Can we maintain another array of &#8216;n&#8217; elements in addition to arrays A and B? space used will be 3n which is still O(n).. is this ok?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
