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...
分类:
其他好文 时间:
2015-06-27 06:24:03
阅读次数:
127
题意:给多个字符串,返回这些字符串的最长公共前缀。思路:直接逐个统计同一个位置上的字符有多少种,如果只有1种,那么就是该位是相同的,进入下一位比较。否则终止比较,返回前缀。可能有一个字符串会比较短,所以前缀最长也只是最短字符串的长度。 1 class Solution { 2 public: 3 ....
分类:
其他好文 时间:
2015-06-27 01:16:45
阅读次数:
268
uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> 上面的 uri 根据你的实际情况定。 ${fn:substring("你要截取的字符串"),beginIndex,endIndex} 网友回复:可以截取,用fn函数: %@ taglib prefix="fn" uri="http://java.su...
分类:
Web程序 时间:
2015-06-26 18:06:08
阅读次数:
183
【LeetCode】Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters.
查找给定字符串中最长的无重复字符的子串...
分类:
其他好文 时间:
2015-06-26 16:22:02
阅读次数:
103
源数据为'yyyymmddhh24miss',则SQL为CONVERT(datetime, SUBSTRING(opentime,1,4) +'/'+SUBSTRING(opentime,5,2) +'/'+SUBSTRING(opentime,7,2)+' ' +SUBSTRING(open...
分类:
数据库 时间:
2015-06-25 19:03:24
阅读次数:
218
// 1、判断strs的长度,如果为0则返回空字符
// 2、找出strs中最短的字串
// 3、采用循环查询的方式依次匹配是否和最短字串相符
// 4、循环中实时更新查询的长度index#include
#include
#include char* longestCommonPrefix(char** strs, int str...
分类:
其他好文 时间:
2015-06-25 14:08:29
阅读次数:
195
1. Question求二叉树的最大深度。Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node do...
分类:
其他好文 时间:
2015-06-25 00:00:30
阅读次数:
281
#104 Maximum Depth of Binary Tree
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...
分类:
其他好文 时间:
2015-06-24 22:38:28
阅读次数:
164
1. Question找字符串数组的最长公共前缀,是所有字符串的。Write a function to find the longest common prefix string amongst an array of strings.2. Solution(O(mn))以第一个字符串作为前缀初值...
分类:
其他好文 时间:
2015-06-24 00:35:28
阅读次数:
125
Leetcode 03 Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters. For e...
分类:
其他好文 时间:
2015-06-23 23:07:53
阅读次数:
115