<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>队列 on</title><link>https://harryzhang.cn/tags/%E9%98%9F%E5%88%97/</link><description>Recent content in 队列 on</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Sun, 19 Mar 2023 21:39:14 +0000</lastBuildDate><atom:link href="https://harryzhang.cn/tags/%E9%98%9F%E5%88%97/index.xml" rel="self" type="application/rss+xml"/><item><title>数据结构(5): 栈|队列|堆</title><link>https://harryzhang.cn/2023-03-19/data-structure-5-stack-queue-heap/</link><pubDate>Sun, 19 Mar 2023 21:39:14 +0000</pubDate><guid>https://harryzhang.cn/2023-03-19/data-structure-5-stack-queue-heap/</guid><description>&lt;h2 id="61-栈"&gt;6.1 栈&lt;/h2&gt;
&lt;h3 id="611用两个栈实现一个队列"&gt;6.1.1用两个栈实现一个队列&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://leetcode-cn.com/problems/implement-queue-using-stacks/" target="_blank" rel="noopener noreffer "&gt;LeetCode No.232&lt;/a&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;题目描述：请你仅使用两个栈实现先入先出队列。队列应当支持一般队列的支持的所有操作（push、pop、peek、empty）：&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;思路：&lt;/strong&gt; 两个栈一个栈做队头（出元素），另一个栈做队尾（入元素）&lt;/p&gt;</description></item></channel></rss>