Leetcode 32题 Given a string containing just the characters ‘(‘ and ‘)’, find the length of the l
【OJ】Longest Valid Parentheses 最长匹配括号子串的长度

Leetcode 32题 Given a string containing just the characters ‘(‘ and ‘)’, find the length of the l
队列是一种常用的数据结构。如果按照常规的想法,要获得队列中的最大值,必须遍历队列中的所有元素,时间复杂度为O(n)。怎么降低这个时间呢?求最大元素很容易想到堆。如果建立一个辅助的最大堆(里面存放队列中元素的指针以及值),入队或者出队的时候,