<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>BIT on k4i's blog</title><link>https://k4i.top/zh/tags/bit/</link><description>Recent content in BIT on k4i's blog</description><generator>Hugo -- gohugo.io</generator><language>zh</language><managingEditor>sky_io@outlook.com (K4i)</managingEditor><webMaster>sky_io@outlook.com (K4i)</webMaster><copyright>All content is subject to the license of &lt;a rel="license noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank"&gt;CC BY-NC-SA 4.0&lt;/a&gt; .</copyright><lastBuildDate>Wed, 20 Jan 2021 14:42:38 +0800</lastBuildDate><atom:link href="https://k4i.top/zh/tags/bit/index.xml" rel="self" type="application/rss+xml"/><item><title>树状数组：Binary Indexed Tree / Fenwick Tree</title><link>https://k4i.top/zh/posts/binary-indexed-tree-or-fenwick-tree/</link><pubDate>Wed, 20 Jan 2021 14:42:38 +0800</pubDate><author>sky_io@outlook.com (K4i)</author><atom:modified>Wed, 20 Jan 2021 14:42:38 +0800</atom:modified><guid>https://k4i.top/zh/posts/binary-indexed-tree-or-fenwick-tree/</guid><description>&lt;p&gt;树状数组能在 \(O(\log n)\) 时间内查询数组的前缀&lt;strong&gt;和&lt;/strong&gt;、更新单个元素，只需要 \(O(n)\) 空间。关键是：每个节点保存一段多长的区间，查询和更新时又该跳到哪个节点？&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://github.com/sky-bro/AC/tree/master/Algorithms/BIT"&gt;源代码&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;</description><dc:creator>K4i</dc:creator><category>BIT</category><category>Fenwick</category><category>Tree</category><category>Data Structure &amp; Algorithm</category></item></channel></rss>