二叉查找树定义 二叉查找树(英语:Binary Search Tree),也称二叉搜索树、有序二叉树(英语:ordered binary tree),排序二叉树(英语:sorted binary tree),是指一棵空树或者具有下列性质的二叉树: 二叉查找树相比于其他数据结构的优势在于查找、插入的时 ...
分类:
编程语言 时间:
2017-11-27 00:01:08
阅读次数:
275
这些一次遍历搞定的,套路无非都是在遍历的时候就记录数据的状态,然后根据遍历到的当前的数据的状态来修改最终结果,当遍历完了的时候结果也就确定了。 题目来源: http://www.lintcode.com/zh-cn/problem/longest-words/ ...
分类:
其他好文 时间:
2017-11-26 11:16:30
阅读次数:
111
class Solution { public: string longestPalindrome(string s) { int len=s.size(); int left,right; int begin=0,maxlen=0; if(len=0&&rightmaxlen) { ... ...
分类:
其他好文 时间:
2017-11-25 20:01:42
阅读次数:
113
Assume s is a string of lower case characters. Write a program that prints the longest substring of s in which the letters occur in alphabetical order ...
分类:
编程语言 时间:
2017-11-24 22:47:36
阅读次数:
176
P1458 顺序的分数 Ordered Fractions P1458 顺序的分数 Ordered Fractions P1458 顺序的分数 Ordered Fractions 题目描述 输入一个自然数N,对于一个最简分数a/b(分子和分母互质的分数),满足1<=b<=N,0<=a/b<=1,请找 ...
分类:
其他好文 时间:
2017-11-23 08:14:37
阅读次数:
182
The longest Increasing Subsequence (LIS) 给定一个序列,找到这个序列的一个最长的子序列,使得子序列的所有元素是升序的,且元素之间的相对位置不变(元素可以在原数组中不相邻,但是相对位置不变) 比如, LIS for { 10, 22, 9, 33, 21, 50 ...
分类:
编程语言 时间:
2017-11-22 14:16:01
阅读次数:
222
Problem reference: https://leetcode.com/problems/longest-substring-without-repeating-characters ...
分类:
其他好文 时间:
2017-11-22 00:53:41
阅读次数:
180
1. 题目: Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", ...
分类:
其他好文 时间:
2017-11-20 19:09:40
阅读次数:
128
Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng ...
分类:
其他好文 时间:
2017-11-18 20:07:24
阅读次数:
190
Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng ...
分类:
其他好文 时间:
2017-11-17 00:06:58
阅读次数:
147