摘要:        
题面 用一个栈实现另外一个栈的顶到底降序排序 要求:不能使用额外的数据结构,但可以使用新的变量。 思路(给定栈s, 辅助栈help) 1. 遍历给定栈(出栈),栈顶出栈cur,与help栈顶比较,如果大于辅助栈顶元素值,那么辅助栈栈顶元素出栈至s栈,直到help栈顶元素值<=cur 2. help压    阅读全文
posted @ 2019-05-09 17:51
yocichen
阅读(834)
评论(0)
推荐(0)
        
            
        
        
摘要:        
11. Container With Most Water 题面 Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines    阅读全文
posted @ 2019-05-09 11:14
yocichen
阅读(293)
评论(0)
推荐(0)
        

 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号