MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / rotate

Method rotate

data_structures/queues/queue_on_pseudo_stack.py:40–45  ·  view source on GitHub ↗
(self, rotation: int)

Source from the content-addressed store, hash-verified

38 number of times to rotate queue"""
39
40 def rotate(self, rotation: int) -> None:
41 for _ in range(rotation):
42 temp = self.stack[0]
43 self.stack = self.stack[1:]
44 self.put(temp)
45 self.length = self.length - 1
46
47 """Reports item at the front of self
48 @return item at front of self.stack"""

Callers 2

getMethod · 0.95
frontMethod · 0.95

Calls 1

putMethod · 0.95

Tested by

no test coverage detected