Chinaunix首页 | 论坛 | 博客
  • 博客访问: 117134
  • 博文数量: 53
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 620
  • 用 户 组: 普通用户
  • 注册时间: 2014-08-24 16:22
文章存档

2014年(53)

我的朋友

发布时间:2014-10-07 15:30:17

Implement strStr().Returns a pointer to the first occurrence of needle in haystack, or null if needle is not part of haystack.我试着用了最简单的匹配,居然过了,以后再用KMP之类的好好研究一下。char *strStr(char *haystack, char *needle) {    .........【阅读全文】

阅读(981) | 评论(0) | 转发(0)

发布时间:2014-10-07 15:26:48

Given a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->NULL.H.........【阅读全文】

阅读(810) | 评论(0) | 转发(0)

发布时间:2014-10-07 15:06:53

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.首先我用了DP,没想到存储没报错,时间报错了,TLE了。原理是记录所有回文,然后更新最大值。比较值得注意.........【阅读全文】

阅读(881) | 评论(0) | 转发(0)

发布时间:2014-10-07 14:55:35

Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring is "()", which has length = 2..........【阅读全文】

阅读(999) | 评论(0) | 转发(0)

发布时间:2014-10-07 14:38:42

Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S = "ADOBECODEBANC"T = "ABC"Minimum window is "BANC"..........【阅读全文】

阅读(896) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册