MCPcopy
hub / github.com/itcharge/AlgoNote / pop

Method pop

codes/python/03_stack_queue_hash_table/stack_link_stack.py:22–28  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

20
21 # 出栈操作
22 def pop(self):
23 if self.is_empty():
24 raise Exception('Stack is empty')
25 else:
26 cur = self.top
27 self.top = self.top.next
28 del cur
29
30 # 获取栈顶元素
31 def peek(self):

Callers 5

heappopMethod · 0.45
monotoneStackFunction · 0.45
monotoneIncreasingStackFunction · 0.45
monotoneDecreasingStackFunction · 0.45

Calls 1

is_emptyMethod · 0.95

Tested by

no test coverage detected