- 博客(18)
- 收藏
- 关注
原创 [Algorithms] Ex.8.10
EX.8.10 NP完全问题 题目 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
265
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
192
原创 [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
187
原创 [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
166
原创 [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
140
原创 [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
195
原创 [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
159
原创 [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
142
原创 [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
142
原创 [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
155
原创 [LeetCode] 7. Reverse Integer
7. Reverse Integer 溢出检查 题目 Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Output: -321 Example 3:
2018-01-30 20:16:36
168
原创 [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
222
原创 [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
162
原创 [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
187
原创 [LeetCode] 3. Longest Substring Without Repeating Characters
3. Longest Substring Without Repeating Characters 暴力算法 哈希表
2017-12-22 22:05:09
268
原创 系统分析设计 - Introduction of SE & OOAD
系统分析设计 Introduction of SE & OOAD 关于软件工程的基础知识
2017-02-26 11:39:43
664
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅