அல்கோரிதம்deque usage
Deque usage — front/back patterns
TT
Testlaa Team
May 14, 2026•1 min read
Window rotate, monotone candidates, cards — இரு முனை.
Try this in Python
from collections import deque
d = deque(range(5))
d.rotate(2)
print(list(d))
while d:
print(d.popleft() if len(d) % 2 else d.pop(), end=" ")
print()
Key takeaways
rotateசிறிய k-க்கு.- Alternating pops — flow practice.
- பெரிய rotation — indices.
Tags:
Stacks & queuesPythonமாணவர்கள்
