骨骼面试有一类比较Tricky的题目,即单调队列 Monotonic Queue / 单调栈 Monotonic Stack
通过单调队列,可以把复杂度降到O(n),主要覆盖Stack, Sliding Window, Two Pointers, Linked List/Queue, HashTable/HashMap等算法和数据结构,分类参考主贴https://www.1point3acres.com/bbs/thread-649468-1-1.html
6个月内
LC42. Trapping Rain Water
LC84. Largest Rectangle in Histogram (单调递增栈)
LC122. Best Time to Buy and Sell Stock II
LC239. Sliding Window Maximum (有界最大值单调递减栈)
LC496. Next Greater Element I
LC862. Shortest Subarray with Sum at Least K (单调递增栈)
LC1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
LC907. Sum of Subarray Minimums,
LC1019. Next Greater Node In Linked List,
LC1019. Next Greater Node In Linked List,
No comments:
Post a Comment