Queue & Stack解题方法小结

Queue & Stack解题方法小结

LeetCode上的相关题目(easy) 155, 225, 232, 346 常用方法 Stack: push(), pop(), peak(), empty() Queue(LinkedList)…

346. Moving Average from Data Stream

346. Moving Average from Data Stream

Given a stream of integers and a window size, calculate the moving average of all integers in the sl…

155. Min Stack

155. Min Stack

Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. pu…

225. Implement Stack using Queues

225. Implement Stack using Queues

Implement the following operations of a stack using queues. push(x) — Push element x onto stac…

232. Implement Queue using Stacks

232. Implement Queue using Stacks

Implement the following operations of a queue using stacks. push(x) — Push element x to the ba…

返回顶部