双向队列
文章平均质量分 92
memcpy0
希望探索文理结合的自由之路。
展开
-
LeetCode 1670. 设计前中后队列【设计,双端队列,数据流】1610
本文属于「征服LeetCode」系列文章之一,这一系列正式开始于2021/08/12。由于LeetCode上部分题目有锁,本系列将至少持续到刷完所有无锁题之日为止;由于LeetCode还在不断地创建新题,本系列的终止日期可能是永远。在这一系列刷题文章中,我不仅会讲解多种解题思路及其优化,还会用多种编程语言实现题解,涉及到通用解法时更将归纳总结出相应的算法模板。。原创 2023-10-16 09:24:12 · 74 阅读 · 0 评论 -
LeetCode C++ 143. Reorder List【LinkedList/Deque】中等
Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You may not modify the values in the list's nodes, only nodes itself may be changed. Example 1: Given 1->2->3->4, reorder it to 1->4->2->3. Example 2: G原创 2020-10-21 22:01:33 · 229 阅读 · 0 评论