- 博客(18)
- 收藏
- 关注
原创 [Algorithms] Ex.8.10
EX.8.10NP完全问题题目Proving NP-completeness by generalization. For each of the problems below, prove that it is NP-complete by showing that it is a generalization of some NP-complete problem we h...
2018-02-08 23:43:49
169
1
原创 [LeetCode] 16. 3Sum Closest
16. 3Sum Closest转化思想头尾指针题目思路转化思想 将问题转化为求三数和为target的问题。复杂性分析: 时间复杂度:O(n^2).空间复杂度:O(1).题解class Solution {public: int threeSumClosest(vectorint>& nums, int target) {
2018-02-07 11:37:56
110
原创 [LeetCode] 15. 3Sum
15. 3Sum头尾指针题目Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: The solutio
2018-02-07 09:59:56
104
原创 [LeetCode] 14. Longest Common Prefix
14. Longest Common Prefix暴力算法题目Write a function to find the longest common prefix string amongst an array of strings.思路暴力遍历以第一个字符串为模板逐一进行比较,直接获得结果。复杂性分析:时间复杂度:O(n*m).空间复杂度:O(1).
2018-01-31 22:52:54
109
原创 [LeetCode] 13. Roman to Integer
13. Roman to Integer罗马数字规则题目Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.思路罗马数字规则 基本表达:I = 1; V = 5; X = 10; L = 50;
2018-01-31 20:52:59
98
原创 [LeetCode] 12. Integer to Roman
12. Integer to Roman罗马数字规则题目Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.思路罗马数字规则 基本表达:I = 1; V = 5; X = 10; L = 50; C =
2018-01-31 19:51:30
135
原创 [LeetCode] 11. Container With Most Water
11. Container With Most Water左右指针题目Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of
2018-01-31 18:05:22
108
原创 [LeetCode] 10. Regular Expression Matching
10. Regular Expression Matching递归动态规划题目Implement regular expression matching with support for '.' and '*'. ‘.’ Matches any single character. ‘*’ Matches zero or more of the precedi
2018-01-31 17:06:33
95
原创 [LeetCode] 9. Palindrome Number
9. Palindrome Number回文数字题目Determine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinking of co
2018-01-31 10:43:31
97
原创 [LeetCode] 8. String to Integer (atoi)
8. String to Integer (atoi)清晰要求题目Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and as
2018-01-31 10:11:04
110
原创 [LeetCode] 7. Reverse Integer
7. Reverse Integer溢出检查题目Given a 32-bit signed integer, reverse digits of an integer.Example 1: Input: 123 Output: 321Example 2: Input: -123 Output: -321Example 3:
2018-01-30 20:16:36
119
原创 [LeetCode] 6. ZigZag Conversion
6. ZigZag Conversion找规律题目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 le
2018-01-30 11:30:09
137
原创 [LeetCode] 5. Longest Palindromic Substring
5. Longest Palindromic Substring中心点扩张Manacher 算法题目Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example: Input: “b
2018-01-25 17:05:50
112
原创 [LeetCode] 4. Median of Two Sorted Arrays
4. Median of Two Sorted Arrays暴力算法二分查找题目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 complexity
2018-01-22 19:31:23
114
原创 [LeetCode] 3. Longest Substring Without Repeating Characters
3. Longest Substring Without Repeating Characters暴力算法哈希表
2017-12-22 22:05:09
174
原创 系统分析设计 - Introduction of SE & OOAD
系统分析设计 Introduction of SE & OOAD关于软件工程的基础知识
2017-02-26 11:39:43
544
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人