Write a function to find the longest common
prefix string amongst an array of strings.
要减少比较次数。在实现过程中我的想法是,2个2个比较,那么只要遍历一次数组就好。而且,在比较过程中,以较短的那个长度作为最大比...
分类:
其他好文 时间:
2014-05-26 21:29:43
阅读次数:
203
Last updated: June 23, 2010Contents[hide]1About
SysLink1.1SysLink Architecture1.2SysLink Usage2Getting Started with
SysLink2.1Building Kernel Image wi...
分类:
其他好文 时间:
2014-05-26 13:35:27
阅读次数:
263
解决方案: 将https修改为http://在Android SDK
manager中,的tools文件夹下,选择options...选项, 勾选 Force https//... sources to be fetched
using http:// 之后点击close 然后再 c:\\wi...
分类:
移动开发 时间:
2014-05-26 11:52:43
阅读次数:
324
1.PHP和js同样是弱类型的语言 字符串的截取php中: $str ="hello world!";
substr($str,1,2);//从字符串的下标为1的地方截取2个字符, eljs中 var str = "hello world!";
str.substring(1,2);//e ...
分类:
其他好文 时间:
2014-05-26 09:55:57
阅读次数:
243
1、$position = index(string,substring,skipchars);
该函数返回子串substring在字符串string中的位置,如果不存在,则返回-1;参数skipchars是可选参数,表示查找之前跳过的字符数,即:从该位置处开始查找;2、rindex(string,...
分类:
其他好文 时间:
2014-05-26 08:22:13
阅读次数:
234
code如下:
//Longest common sequence, dynamic programming method
void FindLCS(char *str1, char *str2)
{
if(str1 == NULL || str2 == NULL)
return;
int length1 = strlen(str1)+1;
int length2 = strlen(...
分类:
其他好文 时间:
2014-05-26 04:56:50
阅读次数:
215
题目一:
Given a binary tree containing digits from 0-9 only, each root-to-leaf
path could represent a number.
An example is the root-to-leaf path 1->2->3 which represents the number 123.
Fin...
分类:
其他好文 时间:
2014-05-26 04:06:41
阅读次数:
248
Palindrome Partitioning
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s.
For example, given s = "...
分类:
其他好文 时间:
2014-05-24 14:29:45
阅读次数:
222
LDA整体流程先定义一些字母的含义:文档集合D,topic集合TD中每个文档d看作一个单词序列,wi表示第i个单词,设d有n个单词。(LDA里面称之为word
bag,实际上每个单词的出现位置对LDA算法无影响)D中涉及的所有不同单词组成一个大集合VOCABULARY(简称VOC)LDA以文档集合D...
分类:
其他好文 时间:
2014-05-23 03:28:59
阅读次数:
562
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-22 16:05:56
阅读次数:
239