摘要: 题意: Implement atoi to convert a string to an integer. (Easy) 分析: 就是注意各种特殊情况,边界情况的判断,见代码注释。 阅读全文
posted @ 2016-08-03 21:55 wangxiaobao1114 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 题意: Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 (Easy) 分析: 思路很简单,注意特殊情况如10,100等和int溢出情况即可; 开始采用的是用一个数组把 阅读全文
posted @ 2016-08-03 21:49 wangxiaobao1114 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 题意: 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 f 阅读全文
posted @ 2016-08-02 21:40 wangxiaobao1114 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 题意: 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 lo 阅读全文
posted @ 2016-08-02 21:34 wangxiaobao1114 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 题目: There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexit 阅读全文
posted @ 2016-08-01 19:18 wangxiaobao1114 阅读(1096) 评论(0) 推荐(0) 编辑
摘要: 题意: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the 阅读全文
posted @ 2016-07-31 20:15 wangxiaobao1114 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 题意: 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 sin 阅读全文
posted @ 2016-07-31 19:04 wangxiaobao1114 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 题目 :Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would hav 阅读全文
posted @ 2016-07-31 18:56 wangxiaobao1114 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 深度优先搜索题目总结(poj2386,poj1979, poj3009,poj1321,aoj0033,aoj0118) 阅读全文
posted @ 2016-06-13 13:39 wangxiaobao1114 阅读(997) 评论(0) 推荐(0) 编辑
摘要: 抽象工厂,组件创建类模式 阅读全文
posted @ 2016-02-27 14:20 wangxiaobao1114 阅读(763) 评论(0) 推荐(0) 编辑