Chinaunix首页 | 论坛 | 博客
  • 博客访问: 80843
  • 博文数量: 29
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 225
  • 用 户 组: 普通用户
  • 注册时间: 2014-03-06 15:31
文章分类

全部博文(29)

文章存档

2015年(18)

2014年(11)

我的朋友

发布时间:2015-01-19 11:26:49

题目:The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L S I I GY I RAnd then read line by line: "PAHNAPLSIIGYIR"Write the co.........【阅读全文】

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

发布时间:2015-01-17 22:50:26

题目: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.最直观的解法,找出该字符串所有子字符串,依次判断该子字符串是否为回文字符串,之后再找出最长的子回文.........【阅读全文】

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

发布时间:2015-01-17 11:38:15

题目:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)Output: 7 -> 0 -> 8解法:.........【阅读全文】

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

发布时间:2015-01-17 11:16:55

题目: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 length of 1.解决方案:点击(此处)折叠.........【阅读全文】

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

发布时间:2015-01-14 17:44:08

题目:There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).我的思路很简单,将两个数组合并为一个有序数组,程序如下:点击(此处)折叠或打开public class Solution {.........【阅读全文】

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

登录 注册