Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
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
heappop
Method · 0.45
monotoneStack
Function · 0.45
monotoneIncreasingStack
Function · 0.45
monotoneDecreasingStack
Function · 0.45
stack_link_stack.py
File · 0.45
Calls
1
is_empty
Method · 0.95
Tested by
no test coverage detected