<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Data Structures on Chen Kai Blog</title><link>https://www.chenk.top/zh/tags/data-structures/</link><description>Recent content in Data Structures on Chen Kai Blog</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Mon, 29 Aug 2022 09:00:00 +0000</lastBuildDate><atom:link href="https://www.chenk.top/zh/tags/data-structures/index.xml" rel="self" type="application/rss+xml"/><item><title>LeetCode（九）：贪心算法</title><link>https://www.chenk.top/zh/leetcode/09-%E8%B4%AA%E5%BF%83%E7%AE%97%E6%B3%95/</link><pubDate>Mon, 29 Aug 2022 09:00:00 +0000</pubDate><guid>https://www.chenk.top/zh/leetcode/09-%E8%B4%AA%E5%BF%83%E7%AE%97%E6%B3%95/</guid><description>&lt;p>贪心算法乍一看像是在“偷懒”——每一步都选眼前最划算的选项，从不回头调整，最后居然还能得到全局最优解。代码通常短小精悍，运行效率也很高。但贪心真正的难点在于&lt;strong>判断一个问题到底能不能用贪心解决&lt;/strong>。同样的一个 &lt;code>argmax&lt;/code> 循环，在跳跃游戏里完全正确，换到 &lt;code>{1, 3, 4}&lt;/code> 的找零问题上却会给出错误答案。&lt;/p></description></item></channel></rss>