算法设计与分析作业
chenxy258
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
算法分析与设计week02--2.Add Two Numbers
LeetCode 2.Add Two Numbers原创 2017-09-26 15:55:27 · 204 阅读 · 0 评论 -
算法分析与设计week12--416. Partition Equal Subset Sum
416. Partition Equal Subset SumDescriptionGiven a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both sub原创 2018-01-13 05:59:03 · 197 阅读 · 0 评论 -
算法分析与设计week13--746. Min Cost Climbing Stairs
746. Min Cost Climbing StairsDescriptionOn a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).Once you pay the cost, you can either climb one or two steps. You ne原创 2018-01-13 06:14:51 · 347 阅读 · 0 评论 -
算法分析与设计week14--70. Climbing Stairs
70. Climbing StairsDescriptionYou are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?原创 2018-01-13 06:26:29 · 232 阅读 · 0 评论 -
算法分析与设计week15--198. House Robber
198. House RobberDescriptionYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing eac原创 2018-01-13 07:10:05 · 388 阅读 · 0 评论 -
算法分析与设计week16--121. Best Time to Buy and Sell Stock
121. Best Time to Buy and Sell StockDescriptionSay you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transacti原创 2018-01-13 07:36:39 · 226 阅读 · 0 评论 -
算法分析与设计week17--698. Partition to K Equal Sum Subsets
698. Partition to K Equal Sum SubsetsDescriptionGiven an array of integers nums and a positive integer k, find whether it’s possible to divide this array into k non-empty subsets whose sums are al原创 2018-01-13 07:43:49 · 267 阅读 · 0 评论 -
算法分析与设计week18--112. Path Sum
112. Path SumDescriptionGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.ExampleGiven the bel原创 2018-01-13 07:54:37 · 305 阅读 · 0 评论 -
算法分析与设计week19--257. Binary Tree Paths
257. Binary Tree PathsDescriptionGiven a binary tree, return all root-to-leaf paths.ExampleFor example, given the following binary tree:1 / \ 2 3 \ 5 All root-to-leaf paths原创 2018-01-13 08:07:11 · 307 阅读 · 0 评论 -
线性表--26. Remove Duplicates from Sorted Array
26. Remove Duplicates from Sorted ArrayDescriptionGiven a sorted array, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra spa原创 2018-01-13 09:31:55 · 270 阅读 · 0 评论 -
线性表--80. Remove Duplicates from Sorted Array II
80. Remove Duplicates from Sorted Array IIDescriptionFollow up for “Remove Duplicates”: What if duplicates are allowed at most twice?ExampleFor example, Given sorted array nums = [1,1,1,原创 2018-01-13 10:26:25 · 348 阅读 · 0 评论 -
算法分析与设计week11--744. Find Smallest Letter Greater Than Target
744. Find Smallest Letter Greater Than TargetDescriptionGiven a list of sorted characters letters containing only lowercase letters, and given a target letter target, find the smallest element in原创 2018-01-12 11:27:48 · 221 阅读 · 0 评论 -
算法分析与设计week10--349. Intersection of Two Arrays
349. Intersection of Two ArraysDescriptionGiven two arrays, write a function to compute their intersection.ExampleGiven nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. Note: Each element i原创 2018-01-11 18:56:07 · 170 阅读 · 0 评论 -
算法分析与设计week03--455.Assign Cookies
455.Assign CookiesDescriptionAssume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which原创 2017-10-17 23:56:57 · 193 阅读 · 0 评论 -
算法分析与设计week03--122.Best Time to Buy and Sell Stock II
Leetcode 122.Best Time to Buy and Sell Stock IIDescriptionSay you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You ma原创 2017-10-17 23:38:06 · 192 阅读 · 0 评论 -
算法分析与设计week01——1.Two Sum
LeetCode 1.Two Sum原创 2017-09-12 15:46:48 · 240 阅读 · 0 评论 -
算法分析与设计week04--55.Jump Game
55.Jump GameDescriptionGiven an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that pos原创 2017-10-18 21:32:05 · 230 阅读 · 0 评论 -
算法分析与设计week04--45.Jump Game II
45.Jump Game IIDescriptionGiven an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that原创 2017-10-19 08:19:09 · 210 阅读 · 0 评论 -
算法分析与设计week05--7.Reverse Integer
7.Reverse IntegerDescriptionReverse digits of an integer. Note: The input is assumed to be a 32-bit signed integer. Your function should return 0 when the reversed integer overflows. ExampleExample1:原创 2017-10-19 10:38:17 · 222 阅读 · 0 评论 -
算法分析与设计week07--435. Non-overlapping Intervals
435. Non-overlapping IntervalsDescriptionGiven a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping.Note: 1.You may assu原创 2017-10-26 07:10:26 · 259 阅读 · 0 评论 -
算法分析与设计week06--452.Minimum Number of Arrows to Burst Balloons
452.Minimum Number of Arrows to Burst BalloonsDescriptionThere are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of t原创 2017-10-25 22:03:44 · 244 阅读 · 0 评论 -
算法分析与设计week08--738. Monotone Increasing Digits
738. Monotone Increasing DigitsDescriptionGiven a non-negative integer N, find the largest number that is less than or equal to N with monotone increasing digits.(Recall that an integer has mo原创 2018-01-11 15:22:02 · 186 阅读 · 0 评论 -
算法分析与设计week09--53. Maximum Subarray
53. Maximum SubarrayDescriptionFind the contiguous subarray within an array (containing at least one number) which has the largest sum.ExampleFor example, given the array [-2,1,-3,4,-1,2,1,-原创 2018-01-11 17:49:40 · 189 阅读 · 0 评论
分享