
算法设计与分析作业
chenxy258
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
算法分析与设计week02--2.Add Two Numbers
LeetCode 2.Add Two Numbers原创 2017-09-26 15:55:27 · 192 阅读 · 0 评论 -
算法分析与设计week12--416. Partition Equal Subset Sum
416. Partition Equal Subset Sum Description Given 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 · 185 阅读 · 0 评论 -
算法分析与设计week13--746. Min Cost Climbing Stairs
746. Min Cost Climbing Stairs Description On 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 · 333 阅读 · 0 评论 -
算法分析与设计week14--70. Climbing Stairs
70. Climbing Stairs Description You 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 · 221 阅读 · 0 评论 -
算法分析与设计week15--198. House Robber
198. House Robber Description You 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 · 371 阅读 · 0 评论 -
算法分析与设计week16--121. Best Time to Buy and Sell Stock
121. Best Time to Buy and Sell Stock Description Say 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 · 212 阅读 · 0 评论 -
算法分析与设计week17--698. Partition to K Equal Sum Subsets
698. Partition to K Equal Sum Subsets Description Given 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 · 248 阅读 · 0 评论 -
算法分析与设计week18--112. Path Sum
112. Path Sum Description Given 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. Example Given the bel原创 2018-01-13 07:54:37 · 296 阅读 · 0 评论 -
算法分析与设计week19--257. Binary Tree Paths
257. Binary Tree Paths Description Given a binary tree, return all root-to-leaf paths. Example For example, given the following binary tree: 1 / \ 2 3 \ 5 All root-to-leaf paths原创 2018-01-13 08:07:11 · 296 阅读 · 0 评论 -
线性表--26. Remove Duplicates from Sorted Array
26. Remove Duplicates from Sorted Array Description Given 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 · 256 阅读 · 0 评论 -
线性表--80. Remove Duplicates from Sorted Array II
80. Remove Duplicates from Sorted Array II Description Follow up for “Remove Duplicates”: What if duplicates are allowed at most twice? Example For example, Given sorted array nums = [1,1,1,原创 2018-01-13 10:26:25 · 341 阅读 · 0 评论 -
算法分析与设计week11--744. Find Smallest Letter Greater Than Target
744. Find Smallest Letter Greater Than Target Description Given 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 · 206 阅读 · 0 评论 -
算法分析与设计week10--349. Intersection of Two Arrays
349. Intersection of Two Arrays Description Given two arrays, write a function to compute their intersection. Example Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. Note: Each element i原创 2018-01-11 18:56:07 · 162 阅读 · 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 · 182 阅读 · 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 · 180 阅读 · 0 评论 -
算法分析与设计week01——1.Two Sum
LeetCode 1.Two Sum原创 2017-09-12 15:46:48 · 227 阅读 · 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 · 217 阅读 · 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 · 197 阅读 · 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 · 212 阅读 · 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 · 247 阅读 · 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 · 237 阅读 · 0 评论 -
算法分析与设计week08--738. Monotone Increasing Digits
738. Monotone Increasing Digits Description Given 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 · 170 阅读 · 0 评论 -
算法分析与设计week09--53. Maximum Subarray
53. Maximum Subarray Description Find the contiguous subarray within an array (containing at least one number) which has the largest sum. Example For example, given the array [-2,1,-3,4,-1,2,1,-原创 2018-01-11 17:49:40 · 179 阅读 · 0 评论