首页 > 其他 > 详细

剑指Offer 30

时间:2019-06-13 09:10:02      阅读:97      评论:0      收藏:0      [点我收藏+]
 1 # -*- coding:utf-8 -*-
 2 class Solution:
 3     def __init__(self):
 4         self.stack = []
 5         self.list = []
 6         
 7     def push(self, node):
 8         self.stack.append(node)
 9         self.list.append(node)
10         self.list = sorted(self.list)
11         # write code here
12     def pop(self):
13         r = self.stack.pop(-1)
14         self.list.remove(r)
15         return r
16         # write code here
17     def top(self):
18         r = self.stack[-1]
19         return r
20         # write code here
21     def min(self):
22         r = self.list[0]
23         return r
24         # write code here

 

剑指Offer 30

原文:https://www.cnblogs.com/asenyang/p/11013875.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!