Esempio n. 1
0
 def push(self, data):
     self.min_stack.append(self.current_min)
     new_node = Node(data)
     new_node.next = self.head
     self.head = new_node
     if self.current_min is None or self.current_min > data:
         self.current_min = data
Esempio n. 2
0
 def push(self, data):
     if self.is_full():
         return
     else:
         new_node = Node(data)
         new_node.next = self.head
         self.head = new_node
         self.current_size += 1