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

Method size

algorithms/data_structures/priority_queue.py:80–86  ·  view source on GitHub ↗

Return the number of elements in the queue. Returns: The queue size.

(self)

Source from the content-addressed store, hash-verified

78 return f"PriorityQueue({self.priority_queue_list!r})"
79
80 def size(self) -> int:
81 """Return the number of elements in the queue.
82
83 Returns:
84 The queue size.
85 """
86 return len(self.priority_queue_list)
87
88 def push(self, item: Any, priority: Any = None) -> None:
89 """Insert an item with the given priority.

Callers 1

test_priority_queueMethod · 0.95

Calls

no outgoing calls

Tested by 1

test_priority_queueMethod · 0.76