MCPcopy
hub / github.com/HuberTRoy/leetCode / pop

Method pop

Stack/ImplementQueueUsingStack.py:48–58  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

46 self.stack_one.push(value)
47
48 def pop(self):
49
50 pop_result = self.stack_two.pop()
51 if self.stack_two.empty():
52 while 1:
53 if self.stack_one.empty():
54 break
55
56 self.stack_two.push(self.stack_one.pop())
57
58 return pop_result
59
60 def peek(self):
61

Callers 1

Calls 2

emptyMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected