MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / put

Method put

data_structures/queues/queue_by_list.py:58–70  ·  view source on GitHub ↗

Put `item` to the Queue >>> queue = QueueByList() >>> queue.put(10) >>> queue.put(20) >>> len(queue) 2 >>> queue Queue((10, 20))

(self, item: T)

Source from the content-addressed store, hash-verified

56 return f"Queue({tuple(self.entries)})"
57
58 def put(self, item: T) -> None:
59 """Put `item` to the Queue
60
61 >>> queue = QueueByList()
62 >>> queue.put(10)
63 >>> queue.put(20)
64 >>> len(queue)
65 2
66 >>> queue
67 Queue((10, 20))
68 """
69
70 self.entries.append(item)
71
72 def get(self) -> T:
73 """

Callers

nothing calls this directly

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected