Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. For exa ...
分类:
编程语言 时间:
2017-03-24 13:06:03
阅读次数:
175
题目: Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. ...
分类:
其他好文 时间:
2017-03-24 10:32:02
阅读次数:
125
一.概述 回忆欧拉回路问题,要求找出一条经过图的每条边恰好一次的路径,这个问题是线性可解的。哈密尔顿圈问题是找一个简单圈,该圈包括图的每一个顶点。对于这个问题,现在还没有发现线性算法。 对于有向图的单源无权最短路径问题也是有线性时间可解的,但是对应的最长简单路径问题(longest-simple-p ...
分类:
其他好文 时间:
2017-03-14 13:39:01
阅读次数:
284
[SPOJ1812]Longest Common Substring II 试题描述 A string is finite sequence of characters over a non-empty finite set Σ. In this problem, Σ is the set of l ...
分类:
其他好文 时间:
2017-03-13 19:13:34
阅读次数:
258
在开始之前我们先输入>>> from sympy import *>>> x, y, z = symbols("x y z") 为一个变量的赋值不限于一个固定的值比如>>> expr = cos(x)+1>>> expr.subs(x,x+y)cos(x + y) + 1这里我们让x+y的表达式赋值 ...
分类:
其他好文 时间:
2017-03-12 21:27:53
阅读次数:
257
class Solution { public: /** * @param s input string * @return the longest palindromic substring */ string longestPalindrome(string &s) { // Write you... ...
分类:
其他好文 时间:
2017-03-11 23:52:17
阅读次数:
349
问题描述 Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the ...
分类:
其他好文 时间:
2017-03-11 21:33:39
阅读次数:
134
1.Factorialize a Number 计算一个整数的阶乘 2.Check for Palindromes 检查字符串是否是回文 3.Find the Longest Word in a String 找到句子中最长单词,并计算其长度 ...
分类:
其他好文 时间:
2017-03-10 13:22:02
阅读次数:
151
Given a string and a string dictionary, find the longest string in the dictionary that can be formed by deleting some characters of the given string. ...
分类:
其他好文 时间:
2017-03-08 22:59:53
阅读次数:
671
Write a function to find the longest common prefix(前缀) string amongst an array of strings. 注意strs[i][j]不要超出范围 ...
分类:
其他好文 时间:
2017-03-02 11:25:29
阅读次数:
129