摘要:
贪心算法的定义:贪心算法是指在对问题求解时,总是做出在当前看来是最好的选择。也就是说,不从整体最优上加以考虑,只做出在某种意义上的局部最优解。贪心算法不是对所有问题都能得到整体最优解,关键是贪心策略的选择,选择的贪心策略必须具备无后效性,即某个状态以前的过程不会影响以后的状态,只与当前状态有关。解题 阅读全文
posted @ 2017-06-09 15:20
鸭子船长
阅读(315)
评论(0)
推荐(0)
摘要:
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 阅读全文
posted @ 2017-06-09 15:03
鸭子船长
阅读(261)
评论(0)
推荐(0)