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

Method get_front

data_structures/queues/queue_by_list.py:118–132  ·  view source on GitHub ↗

Get the front item from the Queue >>> queue = QueueByList((10, 20, 30)) >>> queue.get_front() 10 >>> queue Queue((10, 20, 30)) >>> queue.get() 10 >>> queue.get_front() 20

(self)

Source from the content-addressed store, hash-verified

116 put(get(0))
117
118 def get_front(self) -> T:
119 """Get the front item from the Queue
120
121 >>> queue = QueueByList((10, 20, 30))
122 >>> queue.get_front()
123 10
124 >>> queue
125 Queue((10, 20, 30))
126 >>> queue.get()
127 10
128 >>> queue.get_front()
129 20
130 """
131
132 return self.entries[0]
133
134
135if __name__ == "__main__":

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected