1、使用python實現棧: 1 class stack(): 2 def __init__(self): 3 self.stack = [] 4 def empty(self): 5 return self.stack==[] 6 def push(self,data): 7 self.stack.append(data) 8 def pop(self): 9 if self.empty():
10 return None;
11 else:
12 re
时间:2023-11-07 | 阅读:22