MCPcopy Index your code
hub / github.com/OmkarPathak/pygorithm / dequeue

Method dequeue

pygorithm/data_structures/queue.py:55–68  ·  view source on GitHub ↗

pops an item from the queue which was first inserted

(self)

Source from the content-addressed store, hash-verified

53 self.size += 1
54
55 def dequeue(self):
56 """
57 pops an item from the queue which was first inserted
58 """
59 if self.is_empty():
60 # queue underflow
61 return -1
62 else:
63 self.size -= 1
64 if self.size == 0:
65 self.front = self.rear = 0
66 else:
67 self.rear = self.size - 1
68 return self.queue.pop(0)
69
70 def get_code(self):
71 """

Callers 2

test_queueMethod · 0.95
popMethod · 0.80

Calls 2

is_emptyMethod · 0.95
popMethod · 0.45

Tested by 1

test_queueMethod · 0.76