<?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 memory</title>
    <link>https://mem.leabol.top/tags/%E5%BE%AA%E7%8E%AF%E6%95%B0%E7%BB%84/</link>
    <description>Recent content in 循环数组 on memory</description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <lastBuildDate>Thu, 11 Jun 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://mem.leabol.top/tags/%E5%BE%AA%E7%8E%AF%E6%95%B0%E7%BB%84/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>循环数组</title>
      <link>https://mem.leabol.top/posts/dsa/%E5%BE%AA%E7%8E%AF%E6%95%B0%E7%BB%84/</link>
      <pubDate>Thu, 11 Jun 2026 00:00:00 +0000</pubDate>
      <guid>https://mem.leabol.top/posts/dsa/%E5%BE%AA%E7%8E%AF%E6%95%B0%E7%BB%84/</guid>
      <description>&lt;h2 id=&#34;循环数组&#34;&gt;循环数组&lt;/h2&gt;
&lt;p&gt;需要三个变量:&lt;strong&gt;头下标l,尾下标r,队列的size&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;范围[l, r)&lt;/strong&gt;,  &lt;strong&gt;size== r-l&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;加入元素: 判断&lt;strong&gt;size&amp;lt;capacity&lt;/strong&gt;, 将x放入尾部, 尾部++(如果超过数组边界,返回到数组开头) size++&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
