![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法分析与设计,LeetCode
文章平均质量分 71
MorningK
这个作者很懒,什么都没留下…
展开
-
LeetCode-Longest Palindromic Substring
算法分析与设计,第二周博客 Longest Palindromic Substring Description: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: I原创 2017-09-13 15:13:31 · 225 阅读 · 0 评论 -
LeetCode- First Missing Positive
算法分析与设计,第14周博客 41. First Missing Positive Given an unsorted integer array, find the first missing positive integer. For example, Given [1,2,0] return 3, and [3,4,-1,1] return 2. Your a原创 2017-12-10 14:40:18 · 169 阅读 · 0 评论 -
LeetCode-Edit Distance
算法分析与设计,第13周博客 72. Edit Distance Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.) You have the fo原创 2017-12-01 14:28:30 · 175 阅读 · 0 评论 -
LeetCode-Course Schedule II
算法分析与设计,第12周博客 210. Course Schedule II There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites, for example to take course 0 you have原创 2017-11-23 21:11:41 · 250 阅读 · 0 评论 -
LeetCode-Decode Ways II
算法分析与设计,第16周博客 639. Decode Ways II A message containing letters from A-Z is being encoded to numbers using the following mapping way: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 Beyond that, now th原创 2017-12-24 15:55:30 · 470 阅读 · 0 评论 -
LeetCode-Largest Rectangle in Histogram
算法分析与设计,第15周博客 84. Largest Rectangle in Histogram Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle原创 2017-12-17 16:10:55 · 209 阅读 · 0 评论 -
吝啬SAT问题是NP完全问题的证明
算法概论,第八章课后习题8.3 吝啬SAT问题是这样的:给定一组子句(每个子句都是其中文字的析取)和整数k,求一个最多有k个变量为true的满足赋值——如果该赋值存在。证明吝啬SAT问题为NP完全问题。 首先,证明吝啬SAT问题是NP问题:对于吝啬SAT问题的一个可能解,只需要把解中的每个变量的值带入原子句中,化简后判断其是否为true;另外还需要额外的判断这个解中变量为true的个数是否原创 2017-12-31 17:47:45 · 1084 阅读 · 0 评论 -
LeetCode-Binary Tree Maximum Path Sum
算法分析与设计,第17周博客 124. Binary Tree Maximum Path Sum Given a binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to an原创 2018-01-01 16:24:49 · 215 阅读 · 0 评论 -
LeetCode-Longest Valid Parentheses
算法分析与设计,第19周博客 32. Longest Valid Parentheses Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()"原创 2018-01-13 21:09:48 · 194 阅读 · 0 评论 -
LeetCode-Permutation Sequence
算法分析与设计,第十一周博客。 60. Permutation Sequence The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, We get the following se原创 2017-11-16 16:17:47 · 348 阅读 · 0 评论 -
LeetCode-Kth Largest Element in an Array
算法分析与设计,第九周博客 215. Kth Largest Element in an Array Description Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted o原创 2017-11-05 14:39:24 · 303 阅读 · 0 评论 -
LeetCode-Regular Expression Matching
算法分析与设计,第三周博客。 Regular Expression Matching Implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches zero or more of the preceding elem原创 2017-09-22 15:42:39 · 246 阅读 · 0 评论 -
LeetCode- Longest Palindromic Subsequence
算法分析与设计,第二周博客 Longest Palindromic Subsequence Given a string s, find the longest palindromic subsequence's length in s. You may assume that the maximum length of s is 1000. Example 1: Inp原创 2017-09-13 20:31:58 · 219 阅读 · 0 评论 -
LeetCode-Median of Two Sorted Arrays
算法分析与设计,第一周博客 Median of Two Sorted Arrays Description: 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 tim原创 2017-09-10 19:14:08 · 275 阅读 · 0 评论 -
LeetCode-Trapping Rain Water
算法分析与设计,第四周博客 42. Trapping Rain Water Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.原创 2017-09-30 18:02:33 · 229 阅读 · 0 评论 -
LeetCode-Search in Rotated Sorted Array
算法分析与设计,第八周博客 33. Search in Rotated Sorted Array Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0原创 2017-10-29 15:43:47 · 199 阅读 · 0 评论 -
LeetCode-Merge k Sorted Lists
算法分析与设计,第7周博客 23. Merge k Sorted Lists Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 题意是,给出k个已排好序的链表,把它们合并成一个链表。看完题目以后,可能不是很清楚,但是看到给出的函数接口原创 2017-10-20 23:09:32 · 216 阅读 · 0 评论 -
LeetCode-3Sum
算法分析与设计第6周博客 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原创 2017-10-15 21:45:18 · 163 阅读 · 0 评论 -
LeetCode-Insert Interval
算法分析与设计,第10周博客 57. Insert Interval Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary). You may assume that the intervals were initially原创 2017-11-10 16:10:44 · 231 阅读 · 0 评论 -
LeetCode-Longest Consecutive Sequence
算法分析与设计,第18周博客 128. Longest Consecutive Sequence Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example, Given [100, 4, 200, 1, 3, 2原创 2018-01-07 21:47:02 · 252 阅读 · 0 评论