A Different Task
\epsfbox{p10795a.eps}
The (Three peg) Tower of Hanoi problem is a popular one in computer science. Briefly the problem is to transfer all the disks from peg-A to peg-C using peg-B a...
分类:
其他好文 时间:
2015-06-02 11:21:43
阅读次数:
139
七个字:从后往前先换大就是从后往前扫,1的时候 从最大的可能中先替换3,然后替换2。这个规律就是观察出的,比较好理解。因为“从后往前先换大”的时候,把最大的放在的最后,这样可能就节省了下次的排序。具体代码如下:/*ID: awsd1231PROG: sort3 LANG: C++*/#include...
分类:
其他好文 时间:
2015-06-02 10:52:33
阅读次数:
90
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without using...
分类:
其他好文 时间:
2015-06-02 09:27:36
阅读次数:
118
题目传送门 1 /* 2 很简单的水题,晚上累了,刷刷水题开心一下:) 3 */ 4 #include 5 using namespace std; 6 7 char s1[11][10] = {"zero", "one", "two", "three", "four", "five",...
分类:
其他好文 时间:
2015-06-01 22:16:29
阅读次数:
128
在《高性能MySQL》中文第三版提到了索引的评估:三星评估(three-star system)。 在《High Performance MySQL (3rd Edition)》英文第三版的原文是: Lahdenmaki and Leach’s book also introduces a three-star...
分类:
数据库 时间:
2015-06-01 13:25:58
阅读次数:
182
题目:
Given an array S of n integers, find three integers in S such that the sum is closest to a given number,
target. Return the sum of the three integers. You may assume that each input would have...
分类:
其他好文 时间:
2015-05-31 16:57:59
阅读次数:
123
If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
If all the numbers from 1 to 1000 (one thousand) inclusive we...
分类:
其他好文 时间:
2015-05-31 12:33:14
阅读次数:
126
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without usi...
分类:
其他好文 时间:
2015-05-31 12:31:13
阅读次数:
118
A Pythagorean triplet is a set of three natural numbers, a b c,
for which,
a2 + b2 = c2
For example, 32 + 42 = 9 + 16 = 25 = 52.
There exists exactly one Pythagorean triplet for which a + b + c...
分类:
其他好文 时间:
2015-05-31 09:37:13
阅读次数:
172
chapter three悲伤有N个层面。对于生命是孤独的底色,对于时间是流动的伤感,对于浪漫是起伏的变奏,对于善和怜悯是终生的慨叹…… 出去和舍友买完东西,刚回到宿舍,舍友就说,刚才有人给你打电话了,你回过去吧。 x一听,是他打过来的,放下手里的东西,拨通电话。 心里就像打鼓似的,扑通扑通一阵悸动...
分类:
其他好文 时间:
2015-05-30 18:15:46
阅读次数:
152