<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>基础篇 on moyutianzun 的博客</title><link>https://moyutianzun.com/tags/%E5%9F%BA%E7%A1%80%E7%AF%87/</link><description>Recent content in 基础篇 on moyutianzun 的博客</description><generator>Hugo</generator><language>zh-cn</language><copyright>moyutianzun</copyright><lastBuildDate>Mon, 29 Dec 2025 09:36:52 +0800</lastBuildDate><atom:link href="https://moyutianzun.com/tags/%E5%9F%BA%E7%A1%80%E7%AF%87/index.xml" rel="self" type="application/rss+xml"/><item><title>算法 —— 基础篇：DP</title><link>https://moyutianzun.com/blog/suan-fa------ji-chu-pian-dp/</link><pubDate>Mon, 29 Dec 2025 09:36:52 +0800</pubDate><guid>https://moyutianzun.com/blog/suan-fa------ji-chu-pian-dp/</guid><description>&lt;p style=""&gt;题单来自于：&lt;a href="https://ac.nowcoder.com/discuss/828697?type=101&amp;amp;order=0&amp;amp;pos=2&amp;amp;page=1&amp;amp;channel=-1&amp;amp;source_id=1" target="_self" rel=""&gt;【算法进阶题单】动态规划、数据结构、图论、数学、字符串、计算几何、博弈&lt;/a&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;h1 style="" id="%E7%8A%B6%E6%80%81%E6%9C%BAdp"&gt;状态机DP&lt;/h1&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;h2 style="" id="%E6%97%B6%E9%97%B4%E5%BA%8F%E5%88%97"&gt;时间序列&lt;/h2&gt;&lt;figure style="align-items: center; display: flex; flex-direction: column" data-content-type="image"&gt;&lt;img src="https://moyublog-picture.oss-cn-guangzhou.aliyuncs.com/images/20260429163652697.png" width="1020px"&gt;&lt;/figure&gt;&lt;p style=""&gt;max和mini的&lt;/p&gt;&lt;p style=""&gt;&lt;a href="https://leetcode.cn/problems/best-time-to-buy-and-sell-stock/" class="no-underline hover:text-blue-s dark:hover:text-dark-blue-s truncate cursor-text whitespace-normal hover:!text-[inherit]"&gt;&lt;strong&gt;121. 买卖股票的最佳时机&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;a href="https://leetcode.cn/problems/best-time-to-buy-and-sell-stock-ii/" class="no-underline hover:text-blue-s dark:hover:text-dark-blue-s truncate cursor-text whitespace-normal hover:!text-[inherit]"&gt;&lt;strong&gt;122. 买卖股票的最佳时机 II&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;（有神中神dp）&lt;/strong&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;PD就要看&lt;a href="https://www.bilibili.com/video/BV1ho4y1W7QK" target="_self" rel=""&gt;&lt;strong&gt;买卖股票的最佳时机【基础算法精讲 21】&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;既然有次数限制，就要在遍历的过程中记录次数&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;</description></item><item><title>算法 —— 基础篇：树图、高精度、二分</title><link>https://moyutianzun.com/blog/suan-fa------ji-chu-pian-di-gui-di-tui-shu-tu-gao-jing-du-er-fen-he-dp/</link><pubDate>Sat, 08 Nov 2025 17:12:49 +0800</pubDate><guid>https://moyutianzun.com/blog/suan-fa------ji-chu-pian-di-gui-di-tui-shu-tu-gao-jing-du-er-fen-he-dp/</guid><description>&lt;h1 style="" id="%E9%80%92%E5%BD%92%E9%80%92%E6%8E%A8"&gt;递归递推&lt;/h1&gt;&lt;p style=""&gt;&lt;strong&gt;时间复杂度&lt;/strong&gt;：看for的n，取最大&lt;/p&gt;&lt;p style=""&gt;&lt;strong&gt;空间复杂度&lt;/strong&gt;：看实际运行的时候用到了多少内存。&lt;/p&gt;&lt;blockquote&gt;&lt;p style=""&gt;在递归算法中，每次递推都需要一个栈空间来保存调用记彔，因此在计算空间复杂度时需要计算递归栈的辅助空间。&lt;/p&gt;&lt;/blockquote&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;对于递推和递归来说，其实是完全不同的两个思路&lt;/p&gt;&lt;p style="text-align: center"&gt;&lt;img src="https://moyublog-picture.oss-cn-guangzhou.aliyuncs.com/images/20251108171102541.png" width="989px" height="528px" style="display: inline-block"&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;p style=""&gt;&lt;strong&gt;&lt;u&gt;递归是“一个实体调用自身”&lt;/u&gt;&lt;/strong&gt; 。这具体表现为一个函数直接或间接调用自身，以解决一个给定问题的更小实例 。递归的本质在于&lt;strong&gt;&lt;u&gt;“自我参照”&lt;/u&gt;&lt;/strong&gt;。&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;p style=""&gt;&lt;strong&gt;&lt;u&gt;递推&lt;/u&gt;&lt;/strong&gt;在此上下文中被理解为&lt;strong&gt;&lt;u&gt;迭代计算过程&lt;/u&gt;&lt;/strong&gt;。迭代的定义是“重复执行一组指令” ，通常通过循环结构（如 for, while 或 do-while）来实现 。递推的本质在于&lt;strong&gt;&lt;u&gt;“重复” &lt;/u&gt;&lt;/strong&gt;。&lt;/p&gt;</description></item><item><title>算法 —— 基础篇：数组、双指针、滑动窗口、区间</title><link>https://moyutianzun.com/blog/suan-fa------shu-zu-shuang-zhi-zhen-hua-dong-chuang-kou/</link><pubDate>Fri, 03 Oct 2025 08:49:53 +0800</pubDate><guid>https://moyutianzun.com/blog/suan-fa------shu-zu-shuang-zhi-zhen-hua-dong-chuang-kou/</guid><description>&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;h1 style="" id="%E5%8F%8C%E5%90%91%E5%AD%90%E5%BA%8F%E5%88%97%E4%B9%9F%E6%98%AF%E5%8F%8C%E6%8C%87%E9%92%88"&gt;双向子序列也是双指针&lt;/h1&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;a href="https://leetcode.cn/problems/trapping-rain-water/description/" target="_self" rel=""&gt;接雨水&lt;/a&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;a href="https://leetcode.cn/problems/container-with-most-water/description" target="_self" rel=""&gt;接水最多的容器&lt;/a&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;h2 style="" id="%E5%8F%8C%E6%8C%87%E9%92%88%E7%9A%84%E6%90%9C%E7%B4%A2%E8%8C%83%E5%9B%B4"&gt;双指针的搜索范围&lt;/h2&gt;&lt;p style=""&gt;&lt;a href="https://leetcode.cn/problems/3sum/description" target="_self" rel=""&gt;三数之和&lt;/a&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;&lt;p style=""&gt;&lt;/p&gt;</description></item></channel></rss>