<?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/"
		>
<channel>
	<title>Comments for Zhu Xinquan&#039;s Blog</title>
	<atom:link href="http://www.zhuxinquan.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.zhuxinquan.com</link>
	<description>You may be disappointed if you fail, but you are doomed if you don&#039;t try.</description>
	<lastBuildDate>Sat, 21 Jul 2007 06:42:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>Comment on Notes of Introduction to Algorithm(B-Tree) by Mike McNally</title>
		<link>http://www.zhuxinquan.com/technology/notes-of-introduction-to-algorithmb-tree/#comment-483</link>
		<dc:creator>Mike McNally</dc:creator>
		<pubDate>Sat, 21 Jul 2007 06:42:57 +0000</pubDate>
		<guid isPermaLink="false">http://www2.zhuxinquan.com/wordpress/?p=54#comment-483</guid>
		<description>Hi.  I&#039;m no expert, but as I understand it a &quot;2-3&quot; tree (each node has either one or two entries and two or three (or none) children) are also B-Trees.
</description>
		<content:encoded><![CDATA[<p>Hi.  I&#8217;m no expert, but as I understand it a &#8220;2-3&#8243; tree (each node has either one or two entries and two or three (or none) children) are also B-Trees.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on First home in Shanghai by Gajendra</title>
		<link>http://www.zhuxinquan.com/life/first-home-in-shanghai/#comment-466</link>
		<dc:creator>Gajendra</dc:creator>
		<pubDate>Thu, 19 Jul 2007 21:49:15 +0000</pubDate>
		<guid isPermaLink="false">http://www2.zhuxinquan.com/wordpress/?p=44#comment-466</guid>
		<description>nice room &amp; really you have placed all the thing on the suitable palce.
</description>
		<content:encoded><![CDATA[<p>nice room &#038; really you have placed all the thing on the suitable palce.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Job Opportunity at Morgan Stanley by Leon</title>
		<link>http://www.zhuxinquan.com/shanghai/job-opportunity-at-morgan-stanley/#comment-544</link>
		<dc:creator>Leon</dc:creator>
		<pubDate>Fri, 06 Jul 2007 15:06:27 +0000</pubDate>
		<guid isPermaLink="false">http://www2.zhuxinquan.com/wordpress/?p=75#comment-544</guid>
		<description>How&#039;s the salary go? I know it&#039;s open for the capability, but how much is it?
</description>
		<content:encoded><![CDATA[<p>How&#8217;s the salary go? I know it&#8217;s open for the capability, but how much is it?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Introduction to Algorithms by xinquan</title>
		<link>http://www.zhuxinquan.com/technology/introduction-to-algorithms/#comment-441</link>
		<dc:creator>xinquan</dc:creator>
		<pubDate>Thu, 05 Jul 2007 21:47:11 +0000</pubDate>
		<guid isPermaLink="false">http://www2.zhuxinquan.com/wordpress/?p=18#comment-441</guid>
		<description>Oronno,
Sorry, I　don&#039;t know any other link yet. If you find in the future, please tell me as well.
</description>
		<content:encoded><![CDATA[<p>Oronno,<br />
Sorry, I　don&#8217;t know any other link yet. If you find in the future, please tell me as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Introduction to Algorithms by Oronno</title>
		<link>http://www.zhuxinquan.com/technology/introduction-to-algorithms/#comment-440</link>
		<dc:creator>Oronno</dc:creator>
		<pubDate>Tue, 26 Jun 2007 12:15:19 +0000</pubDate>
		<guid isPermaLink="false">http://www2.zhuxinquan.com/wordpress/?p=18#comment-440</guid>
		<description>Could you please give me another link of CLR&#039;s solution.
Cause the link that u gave for solution is broken..
Thanks..
</description>
		<content:encoded><![CDATA[<p>Could you please give me another link of CLR&#8217;s solution.<br />
Cause the link that u gave for solution is broken..<br />
Thanks..</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Autoconf Macro Reference by budowa domów</title>
		<link>http://www.zhuxinquan.com/linux/autoconf-macro-reference/#comment-434</link>
		<dc:creator>budowa domów</dc:creator>
		<pubDate>Sun, 24 Jun 2007 18:53:16 +0000</pubDate>
		<guid isPermaLink="false">http://www2.zhuxinquan.com/wordpress/?p=6#comment-434</guid>
		<description>Good article and site. Congratulations
</description>
		<content:encoded><![CDATA[<p>Good article and site. Congratulations</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Happy Birthday to Myself again by jjgirl</title>
		<link>http://www.zhuxinquan.com/life/happy-birthday-to-myself-again/#comment-572</link>
		<dc:creator>jjgirl</dc:creator>
		<pubDate>Tue, 05 Jun 2007 11:49:00 +0000</pubDate>
		<guid isPermaLink="false">http://www2.zhuxinquan.com/wordpress/?p=89#comment-572</guid>
		<description>Hei, I don&#039;t know what&#039;s the matter with you.
but I believe you can deal with everything.
Man, you are gonna change, cause all of your friends are watching you for they want you a better life.
For fire, for love, for dead, for live, then it happens, the dream will comes true.
blessing~~
</description>
		<content:encoded><![CDATA[<p>Hei, I don&#8217;t know what&#8217;s the matter with you.<br />
but I believe you can deal with everything.<br />
Man, you are gonna change, cause all of your friends are watching you for they want you a better life.<br />
For fire, for love, for dead, for live, then it happens, the dream will comes true.<br />
blessing~~</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Happy Birthday to Myself again by Hu</title>
		<link>http://www.zhuxinquan.com/life/happy-birthday-to-myself-again/#comment-571</link>
		<dc:creator>Hu</dc:creator>
		<pubDate>Fri, 18 May 2007 00:47:28 +0000</pubDate>
		<guid isPermaLink="false">http://www2.zhuxinquan.com/wordpress/?p=89#comment-571</guid>
		<description>HAPPY BIRTHDAY
</description>
		<content:encoded><![CDATA[<p>HAPPY BIRTHDAY</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Notes of Introduction to Algorithm(Exercise 2.3.7) by 金海</title>
		<link>http://www.zhuxinquan.com/technology/notes-of-introduction-to-algorithmexercise-2-3-7/#comment-442</link>
		<dc:creator>金海</dc:creator>
		<pubDate>Sat, 12 May 2007 23:43:42 +0000</pubDate>
		<guid isPermaLink="false">http://www2.zhuxinquan.com/wordpress/?p=22#comment-442</guid>
		<description>Your code works.
I personally found that the following technique works as well.
First we sort the array using merge sort, which is O(n lg n) in time;
Then, we apply the following procedure
i = 0;
j = n-1; // size of array is n
while (j&gt;i)
if ( a[i] + a[j] == x )
output message and return;
else if ( a[i] + a[j] &gt; x )
--j; // decrease j
else
++i; // increase i;
Each time we reduce the size of the array by 1. So I claim the above procedure is O(n) in time.
Third, totally, it is O( n lgn ) + O (n) = O( n lgn).
Complete code is pasted below and thanks for posting your work.
#include
#include &quot;hjns.h&quot; // for DIM
using namespace std;
void merge(int* a, int p, int q, int r);
void merge_sort(int*a, int p, int r);
void sum(int *a, int n, int x);
int main(int argc, char** argv)
{
int a[] = {1, 4, 9, -10, 8, 5};
int x = -1;
sum(a, DIM(a), x);
return 0;
}
void merge(int* a, int p, int q, int r)
{
int i=p;
int j=q+1;
int k=0;
int* b = new int[r-p+1];
while(ii)
{
if(a[i]+a[j] == x)
{
cout x)
--j;
else
++i;
}
cout&lt;&quot;no two elements add to &quot;&lt;&lt;x&lt;&lt;endl;
}
</description>
		<content:encoded><![CDATA[<p>Your code works.<br />
I personally found that the following technique works as well.<br />
First we sort the array using merge sort, which is O(n lg n) in time;<br />
Then, we apply the following procedure<br />
i = 0;<br />
j = n-1; // size of array is n<br />
while (j>i)<br />
if ( a[i] + a[j] == x )<br />
output message and return;<br />
else if ( a[i] + a[j] > x )<br />
&#8211;j; // decrease j<br />
else<br />
++i; // increase i;<br />
Each time we reduce the size of the array by 1. So I claim the above procedure is O(n) in time.<br />
Third, totally, it is O( n lgn ) + O (n) = O( n lgn).<br />
Complete code is pasted below and thanks for posting your work.<br />
#include<br />
#include &#8220;hjns.h&#8221; // for DIM<br />
using namespace std;<br />
void merge(int* a, int p, int q, int r);<br />
void merge_sort(int*a, int p, int r);<br />
void sum(int *a, int n, int x);<br />
int main(int argc, char** argv)<br />
{<br />
int a[] = {1, 4, 9, -10, 8, 5};<br />
int x = -1;<br />
sum(a, DIM(a), x);<br />
return 0;<br />
}<br />
void merge(int* a, int p, int q, int r)<br />
{<br />
int i=p;<br />
int j=q+1;<br />
int k=0;<br />
int* b = new int[r-p+1];<br />
while(ii)<br />
{<br />
if(a[i]+a[j] == x)<br />
{<br />
cout x)<br />
&#8211;j;<br />
else<br />
++i;<br />
}<br />
cout<&#8220;no two elements add to &#8220;<<x<<endl;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Notes of Introduction to Algorithm(Order Statistics) by xiaozhu</title>
		<link>http://www.zhuxinquan.com/technology/notes-of-introduction-to-algorithmorder-statistics/#comment-444</link>
		<dc:creator>xiaozhu</dc:creator>
		<pubDate>Sun, 25 Mar 2007 22:41:16 +0000</pubDate>
		<guid isPermaLink="false">http://www2.zhuxinquan.com/wordpress/?p=25#comment-444</guid>
		<description>correct
</description>
		<content:encoded><![CDATA[<p>correct</p>
]]></content:encoded>
	</item>
</channel>
</rss>

