Given a string S, find the longest palindromic
substring in S. You may assume that the maximum length of S is 1000, and there
exists one unique longes...
分类:
其他好文 时间:
2014-05-24 04:45:39
阅读次数:
245
1. 题目:找出前100个素数。2.
要求:将前100个素数找出并显示值,要求每行显示5个素数。先列出求100以内素数的C++代码然后根据C++代码写汇编代码,相对来说比较容易。 1 //The
program is to find the primes from 1 to 100 with C++...
分类:
编程语言 时间:
2014-05-24 04:23:06
阅读次数:
450
安装libsvm的时候用到了mex -setup,有的会报 Could not find
the 64-bit compiler. This may indicate that the "X64 Compilers and Tools" or the
Microsoft Windo...
分类:
其他好文 时间:
2014-05-24 03:59:31
阅读次数:
387
题目链接Given a string, find the length of the
longest substring without repeating characters. For example, the longest
substring without repeating letter...
分类:
其他好文 时间:
2014-05-24 02:15:57
阅读次数:
291
Given a binary tree, find its maximum depth.The
maximum depth is the number of nodes along the longest path from the root node
down to the farthest le...
分类:
其他好文 时间:
2014-05-23 11:54:10
阅读次数:
317
如何一气呵成地,on the fly地操作DOM元素呢?
例如顺序执行【创建】-> 【修改】-> 【添加】三个动作。
由于jQuery支持链式操作,其实就是设计模式的builder模式,所以我们可以把三个操作串在一起来执行。
首先创建一个p元素,内容包含一个a元素。
$('jQuery')
然后为a元素添加一个href属性
$('jQuery').find('a').a...
分类:
Web程序 时间:
2014-05-22 12:54:21
阅读次数:
278
当我们使用Destructive Method对wrapper set进行选择、过滤之后会产生一个新的结果集。例如:
html
$lt;div$gt;
$lt;p$gt;Paragraph$lt;/p$gt;
$lt;p$gt;Paragraph$lt;/p$gt;
$lt;/div$gt;
对于上面的DOM Tree,当然可以使用
$('div').find('p')
来获取所...
分类:
Web程序 时间:
2014-05-22 10:41:21
阅读次数:
430
题目:
链接:点击打开链接
算法:
赤裸裸的并查集。
代码:
#include
#include
#include
using namespace std;
int n,m;
int root[1010];
int find(int x)
{
int r = x;
while(root[r] != r)
r = root[r];
...
分类:
其他好文 时间:
2014-05-22 10:36:30
阅读次数:
219
我们在对结果集使用find、filter等方法时,会改变结果集。
这种改变原先结果集的方法被称作destructive jQuery method
jQuery cookbook有如下定义:A destructive operation is any operation that changes the set of matched jQuery elements, which means a...
分类:
Web程序 时间:
2014-05-22 09:40:42
阅读次数:
382
题目:
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 implem...
分类:
其他好文 时间:
2014-05-20 16:22:52
阅读次数:
241