【题目】
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 len...
分类:
其他好文 时间:
2014-05-15 14:40:14
阅读次数:
320
1 public class SlectedSort 2 { 3 public static void
sort(int[] a) 4 { 5 int N = a.length; 6 for (int i = 0; i < N; i++) 7 ...
分类:
其他好文 时间:
2014-05-15 10:25:02
阅读次数:
142
How to use DISM to install a hotfix from within
WindowsJeff Hughes (CORE)15 Feb 2011 10:10 AM22Hello, my name is Emmers Presson.
I am a Support Escala...
1.结构体1>.NSRange(location, length);
从location这个位置开始计数长度为lengthNSRange的创建方式:NSRange r1 = {location, length}; // es:
NSRange r1 = {2, 4}; 一般不这样写NSRange r...
分类:
其他好文 时间:
2014-05-15 09:50:55
阅读次数:
246
【题目】
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 longest palindromic substring.
【题意】
题意是找出字符串S中最长回文子串,S最长为1000,保证有唯一解
【思路】
原字符串用特殊字符#间隔,如下所示:
#a...
分类:
其他好文 时间:
2014-05-15 03:31:25
阅读次数:
299
水题。数字一共就9个,去掉1是用来显示标点的,剩下8个。
穷举一下map,然后有几个数字,就输出这几个数字的排列,是一个dfs嘛。
map num;
void allCombinations(string &digits, int start, int len, string &pres, vector &res){
if(len == digits.length()){
...
分类:
其他好文 时间:
2014-05-15 01:42:26
阅读次数:
264
# 非波拉锲数列def fibs(num): the_list=[] a,b,i=0,1,1 for
i in range(num-1): a,b=b,a+b print bfibs(10)
分类:
编程语言 时间:
2014-05-14 22:00:27
阅读次数:
290
实际上也是一个二分查找的问题。
要找出范围,决定了当找到这个数时不能马上返回,如果找target最前面的那个位置,只有当这个位置等于target,且这个位置的前一个位置不等于target时,才能返回这个位置。如果找的是target最后面的那个位置,那么只有当这个位置等于target,且这个位置的后一个位置不等于target时,才会返回它。不满足返回条件时,下一次递归走什么位置也不一样,找前面的时...
分类:
其他好文 时间:
2014-05-14 21:58:25
阅读次数:
350
staticint_osip_message_parse(osip_message_t*sip,constchar*buf,size_tlength,intsipfrag){inti;constchar*next_header_index;char*tmp;char*beg;tmp=osip_malloc(length+2);if(tmp==NULL){OSIP_TRACE(osip_trace(__FILE__,__LINE__,OSIP_ERROR,NULL,"Couldnotallocatememory..
分类:
其他好文 时间:
2014-05-14 16:06:25
阅读次数:
296
//只扩展为wstring,不考虑编码
std::wstringString2WString(conststd::string&str)
{
std::wstringwstr(str.length(),L‘‘);
std::copy(str.begin(),str.end(),wstr.begin());
returnwstr;
}
//只拷贝低字节至string中
std::stringWString2String(conststd::wstring&ws..
分类:
其他好文 时间:
2014-05-14 15:58:11
阅读次数:
262