随笔分类 -  算法学习

摘要:leetcode 56. Merge Intervals Medium descrition Given a collection of intervals, merge all overlapping intervals. 解析 两个思路,都比较有难度。注意算法正确性的证明。 方法 1 连通分支 阅读全文
posted @ 2017-11-24 23:33 .....? 阅读(378) 评论(0) 推荐(0)
摘要:leetcode 55. Jump Game Medium descrition Given an array of non negative integers, you are initially positioned at the first index of the array. Each e 阅读全文
posted @ 2017-11-24 21:39 .....? 阅读(214) 评论(0) 推荐(0)
摘要:leetcode 54. Spiral Matrix Medium descrition GGiven a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. 阅读全文
posted @ 2017-11-23 00:14 .....? 阅读(260) 评论(0) 推荐(0)
摘要:leetcode 42. Trapping Rain Water Hard descrition Given n non negative integers representing an elevation map where the width of each bar is 1, compute 阅读全文
posted @ 2017-11-22 22:48 .....? 阅读(394) 评论(0) 推荐(0)
摘要:leetcode 48. Rotate Image Medium descrition You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Note: 阅读全文
posted @ 2017-11-19 20:31 .....? 阅读(215) 评论(0) 推荐(0)
摘要:leetcode 41. First Missing Positive Hard descrition Given an unsorted integer array, find the first missing positive integer. Your algorithm should ru 阅读全文
posted @ 2017-11-19 19:54 .....? 阅读(235) 评论(0) 推荐(0)
摘要:leetcode 40. Combination Sum II Medium descrition Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in 阅读全文
posted @ 2017-11-16 20:11 .....? 阅读(235) 评论(0) 推荐(0)
摘要:leetcode 39. Combination Sum Medium descrition Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique comb 阅读全文
posted @ 2017-11-16 19:56 .....? 阅读(331) 评论(0) 推荐(0)
摘要:leetcode 35. Search Insert Position Easy descrition Given a sorted array and a target value, return the index if the target is found. If not, return t 阅读全文
posted @ 2017-11-15 23:37 .....? 阅读(210) 评论(0) 推荐(0)
摘要:leetcode 34. Search for a Range Medium descrition Given an array of integers sorted in ascending order, find the starting and ending position of a giv 阅读全文
posted @ 2017-11-15 23:30 .....? 阅读(213) 评论(0) 推荐(0)
摘要:leetcode 33. Search in Rotated Sorted Array Medium descrition Suppose an array sorted in ascending order is rotated at some pivot unknown to you befor 阅读全文
posted @ 2017-11-15 23:13 .....? 阅读(349) 评论(0) 推荐(0)
摘要:leetcode 31. Next Permutation Medium descrition Implement next permutation, which rearranges numbers into the lexicographically next greater permutati 阅读全文
posted @ 2017-11-15 10:00 .....? 阅读(240) 评论(0) 推荐(0)
摘要:27. Remove Element Easy descrition Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate 阅读全文
posted @ 2017-11-14 00:11 .....? 阅读(195) 评论(0) 推荐(0)
摘要:26. Remove Duplicates from Sorted Array Easy descrition Given a sorted array, remove the duplicates in place such that each element appear only once a 阅读全文
posted @ 2017-11-13 23:35 .....? 阅读(178) 评论(0) 推荐(0)
摘要:18. 4Sum Medium descrition Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique qu 阅读全文
posted @ 2017-11-13 23:34 .....? 阅读(187) 评论(0) 推荐(0)
摘要:leetCode 15. 3Sum Medium descrition 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 阅读全文
posted @ 2017-11-13 23:33 .....? 阅读(154) 评论(0) 推荐(0)
摘要:16. 3Sum Closest Medium descrition Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Re 阅读全文
posted @ 2017-11-13 23:33 .....? 阅读(195) 评论(0) 推荐(0)
摘要:leetCode 11. Container With Most Water Medium descrition Given n non negative integers a1, a2, ..., an, where each represents a point at coordinate (i 阅读全文
posted @ 2017-11-11 22:02 .....? 阅读(293) 评论(0) 推荐(0)
摘要:leetCode 4 Median of Two Sorted Arrays Hard descrition There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of th 阅读全文
posted @ 2017-11-11 00:11 .....? 阅读(305) 评论(0) 推荐(0)
摘要:leetCode 1 Two Sum Easy descrition Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may a 阅读全文
posted @ 2017-11-11 00:10 .....? 阅读(412) 评论(0) 推荐(0)