MCPcopy Index your code
hub / github.com/ndleah/python-mini-project / enqueue

Method enqueue

linked_lists/linked_queue.py:23–30  ·  view source on GitHub ↗
(self, element)

Source from the content-addressed store, hash-verified

21
22
23 def enqueue(self, element):
24 new_tail = self._Node(element, None)
25 if self.is_empty():
26 self._head = new_tail
27 else:
28 self._tail._next = new_tail
29 self._tail = new_tail
30 self._size += 1
31
32 def dequeue(self):
33 if self.is_empty():

Callers

nothing calls this directly

Calls 1

is_emptyMethod · 0.95

Tested by

no test coverage detected