<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>数据结构 on Fulur</title><link>http://example.org/categories/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/</link><description>Recent content in 数据结构 on Fulur</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Tue, 29 Apr 2025 19:52:52 +0800</lastBuildDate><atom:link href="http://example.org/categories/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/index.xml" rel="self" type="application/rss+xml"/><item><title>数据结构：红黑树详解：平衡与效率的完美结合</title><link>http://example.org/posts/data_structure/red-black-trees/</link><pubDate>Tue, 29 Apr 2025 19:52:52 +0800</pubDate><guid>http://example.org/posts/data_structure/red-black-trees/</guid><description>&lt;h2 id="一红黑树核心性质">&lt;strong>一、红黑树核心性质&lt;/strong>&lt;/h2>
&lt;p>红黑树是一种&lt;strong>自平衡二叉查找树&lt;/strong>，通过以下规则确保平衡性：&lt;/p>
&lt;ol>
&lt;li>&lt;strong>颜色规则&lt;/strong>：每个节点非红即黑。&lt;/li>
&lt;li>&lt;strong>根节点规则&lt;/strong>：根节点必为黑色。&lt;/li>
&lt;li>&lt;strong>叶子节点规则&lt;/strong>：所有叶子节点（NIL节点）均为黑色。&lt;/li>
&lt;li>&lt;strong>红色节点规则&lt;/strong>：红色节点的子节点必须为黑色（不允许连续红色节点）。&lt;/li>
&lt;li>&lt;strong>黑高规则&lt;/strong>：从任一节点到其所有叶子节点的路径中，黑色节点数量相同（黑高一致）。&lt;/li>
&lt;/ol>
&lt;hr>
&lt;h2 id="二插入操作详解">&lt;strong>二、插入操作详解&lt;/strong>&lt;/h2>
&lt;p>红黑树的插入分两步：&lt;strong>标准BST插入&lt;/strong> + &lt;strong>平衡修复&lt;/strong>。&lt;/p></description></item></channel></rss>