1、 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 farthes
分类:
其他好文 时间:
2016-03-22 19:06:39
阅读次数:
114
1、 Given a dictionary, find all of the longest words in the dictionary. Given the longest words are(is) ["internationalization"]. 2、 思路: 1、得到数组里面最长的字符
分类:
其他好文 时间:
2016-03-21 18:22:08
阅读次数:
174
Write a function to find the longest common prefix string amongst an array of strings. 思路: 1.其中任意一串一定大于或等于最长子串的长度 2.从第一个串第一位开始与之后的串进行匹配,如不匹配,已匹配好的子串即是
分类:
其他好文 时间:
2016-03-19 01:00:46
阅读次数:
244
1、 Give an integer array,find the longest increasing continuous subsequence in this array. An increasing continuous subsequence: For [5, 4, 2, 1, 3],
分类:
其他好文 时间:
2016-03-18 17:33:02
阅读次数:
132
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 l
分类:
其他好文 时间:
2016-03-18 09:27:07
阅读次数:
131
d.最长上升子序列 s.注意是严格递增 c.O(nlogn) c2.O(n^2)
分类:
其他好文 时间:
2016-03-17 19:09:40
阅读次数:
114
最初思路,也是最简单的思路,维护一个string res,保留当前的不重复的字符串。string s一位位读进,读进每一位时和res中的每一位进行比较,没有重复就加入res;重复了的话,res就只保留与s[i]重复的那个char右边的部分,并加上s[i],在对res进行截取操作之前更新maxLen。
分类:
其他好文 时间:
2016-03-16 20:57:43
阅读次数:
213
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
分类:
其他好文 时间:
2016-03-14 18:34:09
阅读次数:
207
Given an integer matrix, find the length of the longest increasing path. From each cell, you can either move to four directions: left, right, up or do
分类:
其他好文 时间:
2016-03-08 21:24:13
阅读次数:
189