题目:Maximum Depth of Binary TreeGiven a binary tree,
find its maximum depth.The maximum depth is the number of nodes along the
longest path from the ro...
分类:
其他好文 时间:
2014-06-10 10:09:13
阅读次数:
237
戳我去解题Write a function to find the longest
common prefix string amongst an array of strings.class Solution {public: string
longestCommonPrefix(vecto...
分类:
其他好文 时间:
2014-06-10 08:29:55
阅读次数:
189
题目:Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s.
解题思路:
回文划分,题目意思是给一个字符串,找出将字符串划分为一系列回文子串的各种可能组合。例如,一个子串“aab“,你需要返回["aa","b"],["a","a","b"]。这个题目的解法也是非常的典型---循环加递归,...
分类:
其他好文 时间:
2014-06-09 23:24:11
阅读次数:
256
一次总结两道题,两道题目都比较基础Description:Write a function to
find the longest common prefix string amongst an array of strings.分析:
这道题目最重要的知道什么叫prefix前缀, 否则一不小心就做...
分类:
其他好文 时间:
2014-06-09 21:08:16
阅读次数:
224
You are given a string, S, and a list of words,
L, that are all of the same length. Find all starting indices of substring(s) in
S that is a concatena...
分类:
其他好文 时间:
2014-06-09 17:49:34
阅读次数:
240
1) { string after = field.Substring(1); result =
first + after; } return result; ...
分类:
其他好文 时间:
2014-06-08 19:19:20
阅读次数:
347
问题重现:
MySql 数据库中,一给列的内容中包括 “.wmv” 需要将 “.” 后的wmv格式 换为“flv”
解决办法
update video_info set file_path=substring(file_path,1,length(file_path)-3);
先执行以上SQL进行删除;
update video_info set file_path =...
分类:
数据库 时间:
2014-06-08 16:38:39
阅读次数:
262
题目
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 leaf node.
方法
使用DFS对树进行遍...
分类:
其他好文 时间:
2014-06-08 10:26:33
阅读次数:
207
var Cts = "bblText";
if(Cts.indexOf("Text") > 0 )
{
alert('Cts中包含Text字符串');
}
indexOf用法:
返回 String 对象内第一次出现子字符串的字符位置。
strObj.indexOf(subString[, startIndex])
参数
...
分类:
Web程序 时间:
2014-06-08 05:00:36
阅读次数:
300
题目:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For "bbbbb" the longest substring is "b", with the length...
分类:
其他好文 时间:
2014-06-08 03:06:52
阅读次数:
221