<?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>Leetcod on Garlic Space</title><link>https://garlicspace.com/tags/leetcod/</link><description>Recent content in Leetcod on Garlic Space</description><generator>Hugo -- 0.152.2</generator><language>zh-cn</language><lastBuildDate>Fri, 14 Jun 2019 00:00:00 +0000</lastBuildDate><atom:link href="https://garlicspace.com/tags/leetcod/feed.xml" rel="self" type="application/rss+xml"/><item><title>LeetCode – Design Circular Queue</title><link>https://garlicspace.com/posts/leetcode-design-circular-queue/</link><pubDate>Fri, 14 Jun 2019 00:00:00 +0000</pubDate><guid>https://garlicspace.com/posts/leetcode-design-circular-queue/</guid><description>&lt;h2 id="题目"&gt;题目：&lt;/h2&gt;
&lt;p&gt;Design your implementation of the circular queue. The circular queue is a linear data structure in which the operations are performed based on FIFO (First In First Out) principle and the last position is connected back to the first position to make a circle. It is also called &amp;ldquo;Ring Buffer&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;One of the benefits of the circular queue is that we can make use of the spaces in front of the queue. In a normal queue, once the queue becomes full, we cannot insert the next element even if there is a space in front of the queue. But using the circular queue, we can use the space to store new values.&lt;/p&gt;</description></item></channel></rss>