MCPcopy
hub / github.com/keon/algorithms / PriorityQueueNode

Class PriorityQueueNode

algorithms/data_structures/priority_queue.py:21–39  ·  view source on GitHub ↗

A node holding data and its priority. Args: data: The stored value. priority: The priority of this node.

Source from the content-addressed store, hash-verified

19
20
21class PriorityQueueNode:
22 """A node holding data and its priority.
23
24 Args:
25 data: The stored value.
26 priority: The priority of this node.
27 """
28
29 def __init__(self, data: Any, priority: Any) -> None:
30 self.data = data
31 self.priority = priority
32
33 def __repr__(self) -> str:
34 """Return a string representation of the node.
35
36 Returns:
37 Formatted string with data and priority.
38 """
39 return f"{self.data}: {self.priority}"
40
41
42class PriorityQueue:

Callers 1

pushMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected