
贪心 分治
yuccess
这个作者很懒,什么都没留下…
展开
-
55. Jump Game
Given 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 position. Determine i原创 2017-01-02 01:20:38 · 224 阅读 · 0 评论 -
134. Gas Station
There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to原创 2017-01-02 09:18:21 · 184 阅读 · 0 评论 -
135. Candy 考验逻辑能力的时候到了
There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the following requirements: Each child must have at least on原创 2017-01-02 14:20:07 · 274 阅读 · 0 评论 -
23. Merge k Sorted Lists 典型的分治,另,合并两个List的好写法
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *ne原创 2017-01-03 10:31:25 · 301 阅读 · 0 评论