Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TheAlgorithms/Python
/ is_empty
Method
is_empty
graphs/minimum_spanning_tree_prims2.py:97–99 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
95
return
str(self.heap)
96
97
def
is_empty(self) -> bool:
98
# Check if the priority queue is empty
99
return
self.elements == 0
100
101
def
push(self, elem: T, weight: int) -> None:
102
# Add an element with given priority to the queue
Callers
1
prims_algo
Function · 0.95
Calls
no outgoing calls
Tested by
no test coverage detected