<?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>Back To Will a.k.a. i.am.Ben &#187; 专插本</title> <atom:link href="http://www.iambencn.com/tag/%e4%b8%93%e6%8f%92%e6%9c%ac/feed/" rel="self" type="application/rss+xml" /><link>http://www.iambencn.com</link> <description>F100fd闯天下.... Maroon 5 &#38; Rihanna... ^_^</description> <lastBuildDate>Tue, 03 Jan 2012 16:31:51 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>二叉树先序、中序、后序三种遍历的非递归算法</title><link>http://www.iambencn.com/2009/10/12/bi-tree-traversal-pre-in-post-order/</link> <comments>http://www.iambencn.com/2009/10/12/bi-tree-traversal-pre-in-post-order/#comments</comments> <pubDate>Mon, 12 Oct 2009 14:57:19 +0000</pubDate> <dc:creator>i.am.Ben</dc:creator> <category><![CDATA[备考资料]]></category> <category><![CDATA[专插本]]></category> <category><![CDATA[数据结构]]></category><guid isPermaLink="false">http://www.iambencn.com/?p=471</guid> <description><![CDATA[先序遍历非递归算法 中序遍历非递归算法 后序遍历非递归算法]]></description> <content:encoded><![CDATA[<h3>先序遍历非递归算法</h3><pre class="brush: cpp; collapse: true; light: false; title: ; toolbar: true; notranslate">
#define maxsize 100
typedef struct {
	Bitree Elem[maxsize];
	int top;
}SqStack;

void PreOrderUnrec(Bitree t) {
	SqStack s;
	StackInit(s);
	p=t;

	while (p!=null || !StackEmpty(s)) {
		while (p!=null) {			 // 遍历左子树
			visite(p-&gt;data);
			push(s,p);
			p=p-&gt;lchild;
		} // endwhile

		if (!StackEmpty(s)) {		 // 通过下一次循环中的内嵌while实现右子树遍历
			p=pop(s);
			p=p-&gt;rchild;
		} // endif

	} // endwhile 

} // PreOrderUnrec
</pre><h3>中序遍历非递归算法</h3><pre class="brush: cpp; collapse: true; light: false; title: ; toolbar: true; notranslate">
#define maxsize 100
typedef struct {
	Bitree Elem[maxsize];
	int top;
}SqStack;

void InOrderUnrec(Bitree t) {
	SqStack s;
	StackInit(s);
	p=t;
	while (p!=null || !StackEmpty(s)) {
		while (p!=null) {			 // 遍历左子树
			push(s,p);
			p=p-&gt;lchild;
		} // endwhile

		if (!StackEmpty(s)) {
			p=pop(s);
			visite(p-&gt;data);		// 访问根结点
			p=p-&gt;rchild;		// 通过下一次循环实现右子树遍历
		} // endif   

	} // endwhile

} // InOrderUnrec
</pre><h3>后序遍历非递归算法</h3><pre class="brush: cpp; collapse: true; light: false; title: ; toolbar: true; notranslate">
#define maxsize 100
typedef enum{L,R} tagtype;
typedef struct {
	Bitree ptr;
	tagtype tag;
}stacknode;

typedef struct {
	stacknode Elem[maxsize];
	int top;
}SqStack;

void PostOrderUnrec(Bitree t) {
	SqStack s;
	stacknode x;
	StackInit(s);
	p=t;

	do {
		while (p!=null) {		// 遍历左子树
			x.ptr = p;
			x.tag = L;		 // 标记为左子树
			push(s,x);
			p=p-&gt;lchild;
		}

		while (!StackEmpty(s) &amp;&amp; s.Elem[s.top].tag==R) {
			x = pop(s);
			p = x.ptr;
			visite(p-&gt;data);   // tag为R，表示右子树访问完毕，故访问根结点
		}

		if (!StackEmpty(s)) {
			s.Elem[s.top].tag =R;	 // 遍历右子树
			p=s.Elem[s.top].ptr-&gt;rchild;
		}
	} while (!StackEmpty(s));
} // PostOrderUnrec
</pre>]]></content:encoded> <wfw:commentRss>http://www.iambencn.com/2009/10/12/bi-tree-traversal-pre-in-post-order/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>I Love You, Man</title><link>http://www.iambencn.com/2009/07/25/i-love-you-man/</link> <comments>http://www.iambencn.com/2009/07/25/i-love-you-man/#comments</comments> <pubDate>Fri, 24 Jul 2009 16:30:41 +0000</pubDate> <dc:creator>i.am.Ben</dc:creator> <category><![CDATA[小benben的日记]]></category> <category><![CDATA[Brad Pitt]]></category> <category><![CDATA[Friends]]></category> <category><![CDATA[Jason Segel]]></category> <category><![CDATA[Jennifer Anniston]]></category> <category><![CDATA[Paul Rudd]]></category> <category><![CDATA[Saturday Night Live]]></category> <category><![CDATA[Will & Grace]]></category> <category><![CDATA[专插本]]></category> <category><![CDATA[数据结构]]></category> <category><![CDATA[电影]]></category> <category><![CDATA[美剧]]></category><guid isPermaLink="false">http://www.iambencn.com/?p=444</guid> <description><![CDATA[今天接下了这个片，其实就是冲着 Paul Rudd 去的。自从看了他的那集 SNL，那爱就大大大大的有。不过这人真让人有想杀人的感觉，都40的人了，怎么还能那么娃娃？剧情暂时还不知道，下片就要下高清的！虽然 Flow 是总爱 crash，我也不知道怎么回事…而且它还不支持编码设置…WTF! Paul Rudd 貌似铁了心做喜剧专业户，总跟搞喜剧的人混一起。sigh…plus 他 gay 场十足，应该还会有很多片约…只是他真的太可爱了… 看了好多美剧，还是没把这部看完。也不是不喜欢，只是受不了大家分开。至今我还没把 Will &#38; Grace 的最后几分钟看完。到 00:20:00 的时候我就受不了，很受不了受不了。所以咯，Friends 我应该也是看到 Season 10 的最后几分钟也不看，让他们一直都 go on，never come to a finale…哈 也不知道是巧还是怎么，我刚好看到 Paul Rudd 的这几集…天，那时候他的演技真叫一个青涩啊…不过还好他会卖乖巧，一咧嘴大笑，甜得都让我觉得他演技无所谓了…*_* 其实我一直没法理解怎么那么多人喜欢 Brad Pitt，长得也不帅啊，怎么能红得那么厉害？昨天看了他的那集，才发现他年轻的时候是惊天动地泣鬼神地帅…天…stunning都没法形容的那种…看着 Jennifer Aniston 看着他的那眼神，那是没法掩饰的爱…只是他们那集没对手戏，JA 会不会暗自后悔咧？或者真的很空虚很寂寞的时候，JA 会拿出这集一直看一直看，然后还一边诅咒着 Angelina Jolie…嘿嘿 P.S.: 看了 He's Not That Into You，JA 果真还是票房毒药…这么好的个角色给她演得太平淡了… 实在是不舒服…plus 数据结构真的好难好难…三天都还卡在第二章链表这…真怀疑自己是不是有这个能力驾驭算法…sigh [...]]]></description> <content:encoded><![CDATA[<p><a title="I Love You, Man Poster" href="http://farm4.static.flickr.com/3451/3308888203_d5e82652af_b.jpg"><img src="http://farm4.static.flickr.com/3451/3308888203_d5e82652af_b.jpg" alt="I Love You, Man Poster" width="600" /></a></p><p>今天接下了这个片，其实就是冲着 Paul Rudd 去的。自从看了他的那集 SNL，那爱就大大大大的有。不过这人真让人有想杀人的感觉，都40的人了，怎么还能那么娃娃？剧情暂时还不知道，下片就要下高清的！虽然 Flow 是总爱 crash，我也不知道怎么回事…而且它还不支持编码设置…WTF! Paul Rudd 貌似铁了心做喜剧专业户，总跟搞喜剧的人混一起。sigh…plus 他 gay 场十足，应该还会有很多片约…只是他真的太可爱了…</p><p><img src="http://farm4.static.flickr.com/3175/2765403430_1fc1b78204_o.jpg" alt="Friends Season 9" /></p><p>看了好多美剧，还是没把这部看完。也不是不喜欢，只是受不了大家分开。至今我还没把 Will &amp; Grace 的最后几分钟看完。到 00:20:00 的时候我就受不了，很受不了受不了。所以咯，Friends 我应该也是看到 Season 10 的最后几分钟也不看，让他们一直都 go on，never come to a finale…哈</p><p>也不知道是巧还是怎么，我刚好看到 Paul Rudd 的这几集…天，那时候他的演技真叫一个青涩啊…不过还好他会卖乖巧，一咧嘴大笑，甜得都让我觉得他演技无所谓了…*_*</p><p><img src="http://farm1.static.flickr.com/3/3182984_b9dcabcb28_o.jpg" alt="" /></p><p>其实我一直没法理解怎么那么多人喜欢 Brad Pitt，长得也不帅啊，怎么能红得那么厉害？昨天看了他的那集，才发现他年轻的时候是惊天动地泣鬼神地帅…天…stunning都没法形容的那种…看着 Jennifer Aniston 看着他的那眼神，那是没法掩饰的爱…只是他们那集没对手戏，JA 会不会暗自后悔咧？或者真的很空虚很寂寞的时候，JA 会拿出这集一直看一直看，然后还一边诅咒着 Angelina Jolie…嘿嘿</p><p>P.S.: 看了 He's Not That Into You，JA 果真还是票房毒药…这么好的个角色给她演得太平淡了…</p><p><a href="http://farm4.static.flickr.com/3532/3751956085_37a060df06_o.png"><img src="http://farm4.static.flickr.com/3532/3751956085_37a060df06_o.png" alt="数据结构" width="600" /></a></p><p>实在是不舒服…plus 数据结构真的好难好难…三天都还卡在第二章链表这…真怀疑自己是不是有这个能力驾驭算法…sigh</p><p>说好 11 点睡的…sigh 看来我是活不久的了…挖</p> ]]></content:encoded> <wfw:commentRss>http://www.iambencn.com/2009/07/25/i-love-you-man/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>吉林大学高等数学全 160 讲 + 辅导 5 讲</title><link>http://www.iambencn.com/2009/07/13/higher-math-jilin-university-download/</link> <comments>http://www.iambencn.com/2009/07/13/higher-math-jilin-university-download/#comments</comments> <pubDate>Mon, 13 Jul 2009 14:27:52 +0000</pubDate> <dc:creator>i.am.Ben</dc:creator> <category><![CDATA[备考资料]]></category> <category><![CDATA[专插本]]></category> <category><![CDATA[高等数学]]></category><guid isPermaLink="false">http://www.iambencn.com/?p=431</guid> <description><![CDATA[部分解压密码 08.rar ：jieya2005 18.rar ：h-jieya2005 38.rar ：u-jieya2005 88.rar ：a-jieya2005 98.rar ：n-jieya2005 108.rar：g-jieya2005 下载：吉林大学高等数学BT下载]]></description> <content:encoded><![CDATA[<p>部分解压密码</p><ul><li>08.rar ：jieya2005</li><li>18.rar ：h-jieya2005</li><li>38.rar ：u-jieya2005</li><li>88.rar ：a-jieya2005</li><li>98.rar ：n-jieya2005</li><li>108.rar：g-jieya2005</li></ul><p>下载：<a href='http://www.iambencn.com/wp-content/uploads/2009/07/Math.torrent'>吉林大学高等数学BT下载</a></p> ]]></content:encoded> <wfw:commentRss>http://www.iambencn.com/2009/07/13/higher-math-jilin-university-download/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>C语言专插本考试常用算法</title><link>http://www.iambencn.com/2009/06/14/c-language-common-algorithms/</link> <comments>http://www.iambencn.com/2009/06/14/c-language-common-algorithms/#comments</comments> <pubDate>Sun, 14 Jun 2009 05:39:09 +0000</pubDate> <dc:creator>i.am.Ben</dc:creator> <category><![CDATA[备考资料]]></category> <category><![CDATA[C]]></category> <category><![CDATA[专插本]]></category> <category><![CDATA[算法]]></category><guid isPermaLink="false">http://www.iambencn.com/2009/06/14/c%e8%af%ad%e8%a8%80%e4%b8%93%e6%8f%92%e6%9c%ac%e8%80%83%e8%af%95%e5%b8%b8%e7%94%a8%e7%ae%97%e6%b3%95/</guid> <description><![CDATA[1递归法转换整数为字符 void convert(int n) { int t; if((t=n/10)!=0) convert(t); putch(n%10+'0'); } 2判断素数 int isPrime(int n) { int i; for(i=2;ic) { t=b; b=c; c=t; } * 若要求由大到小顺序输出，改'>'为']]></description> <content:encoded><![CDATA[<p>1递归法转换整数为字符</p><pre lang="c" line="1">void convert(int n) {
	int t;
	if((t=n/10)!=0)
	convert(t);
	putch(n%10+'0');
}</pre><p>2判断素数</p><pre lang="c" line="1">int isPrime(int n) {
	int i;
	for(i=2;i<n/2;i++)
	if(n%i==0) return 0;
	return 1;
}</pre><p>3求闰年</p><pre lang="c" line="1">if((year%4==0&#038;year%100!=0)||(year%400)==0)
	printf("%d is a leap year",year);
else
	printf("%d is not a leap year",year);</pre><p>4求N的阶乘</p><pre lang="c" line="1">for(int t=1,i=2;i<=N;i++)
	t*=i;
printf("%d",t);</pre><p>5求m和n最大公约数和最小公倍数</p><pre lang="c" line="1">if(a<b) {
	a=t;
	a=b;
	b=t;
}
r=a%b;
while(r) {
	a=b;
	b=r;
	r=a%b;
}
printf("(a,b)最大公约数%d,(a,b)最小公倍数%d",r,ab/r);</pre><p>6大写字母改小写字母</p><pre lang="c" line="1">c1=getchar();
c2=c1+32;
printf("%c,%c",c1,c2);</pre><p>7小写字母改大写字母</p><pre lang="c" line="1">c1=getchar();
c2=c1-32;
printf("%c,%c",c1,c2);</pre><p>8求3个数由小到大的顺序输出</p><pre lang="c" line="1">if(a>b){
t=a;a=b;b=t;
}
if(a>c) {
	t=a;
	a=c;
	c=t;
}
if(b>c) {
	t=b;
	b=c;
	c=t;
}</pre><p>* 若要求由大到小顺序输出，改'>'为'<'即可。</p><p>9求ax*x+b*x+c方程的解</p><pre lang="c" line="1">if(fabs(a)<=1e-6)
	printf("非二次方程");
else
	disc=b*b-4*a*c;
if(fabs(disc)<=1e-6)
	printf("有两相等实根：%f\n",-b/(2*a));
else if(fabs(disc)>1e-6) {
	x1=(-b+sqrt(disc))/(2*a);
	x2=(-b-sqrt(disc))/(2*a);
	printf("有两相异实根：%f和%f\n",x1,x2);
} else {
	realpart=-b/(2*a);
	imagpart=sqrt(-disc)/(2*a);
	printf("有两共轭复根：\n");
	printf("%f+%fi\n",realpart,imagpart);
	printf("%f-%fi\n",realpart,imagpart);
}</pre><p>10冒泡法排序  (由小到大)</p><pre lang="c" line="1">int a[N+1];
for(i=1;i<=N;i++) /* 输入N个数  (数组输入功能) */
	scanf("%d",&#038;a);
for(j=1;j<N;j++)     /* 排序开始 */
	for(i=1;i<=N-j;i++)
		if(a>a[i+1]) {
			t=a;
			a=a[i+1];
			a[i+1]=t;
		}
for(i=1;i<=N;i++)   /* 输出排好的这N个数 (数组输出功能) */
	printf("%d",a);</pre><p>11选择法排序  (由小到大)</p><pre lang="c" line="1">/* 子程序部分 */
void sort(int array[],int n) {
int i,j,k,t;
for(i=0;i<n-1;i++) {
	k=i;
	for(j=i+1;j<n;j++)
		if(array[j]<array[k]) k=j;
	t=array[k];
	array[k]=array;
	array=t;
}
}</pre><p>12插入法排序int a[N];</p><pre lang="c" line="1">/* 省略数组输入 (见上：冒泡法) */
for(i=1;i<N;i++) {
	m=a;
	j=i-1;
	while(j>=0&#038;&m>a[j]) {
		a[j+1]=a[j];
		j--;
	}
	a[j]=m;
}
/* 省略数组输出 (见上：冒泡法) */
</pre><p>13.数列中查找一个关键字<br /> (1)折半法</p><pre lang="c" line="1">BinarySearch(a,n,x,j)
k=0;
m=n-1;
while(k<=m) {
	j=(k+m)/2;
	if(x==a[j]) exit;
	else if(x<a[j]) m=j-1;
	else k=j+1;
}
if(k>m) j=0;
	printf("%d",j);</pre><p>(2)顺序查找法</p><pre lang="c" line="1">int a[N];
/* 省略数组输入 (见上：冒泡法) */
for(i=0;i<N;i++)
if(x==a) {
	printf("找到！序号为：%d\n",--i);
	break;
}
if(i==8)
	printf("没找到!");</pre><p>(3)快速顺序查找法</p><pre lang="c" line="1">int a[N];
/* 省略数组输入 (见上：冒泡法) */
a[N-1]=x;
i=0;
while(a!=x) i++;
if(i<N-1)
	printf("找到！序号为：%d\n",i);
else
	printf("没找到!");</pre>]]></content:encoded> <wfw:commentRss>http://www.iambencn.com/2009/06/14/c-language-common-algorithms/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 1/19 queries in 0.079 seconds using disk: basic
Object Caching 409/451 objects using disk: basic

Served from: www.iambencn.com @ 2012-02-08 07:18:56 -->
