Colors: Green = Front, Blue = Rear, Orange = Both/Current, Gray = Empty
Circular Queue is a linear data structure that connects the end back to the beginning, forming a circle.
Key Characteristics:
Why use Circular Queues?
Common Applications:
Operation | Time Complexity | Space Complexity |
---|---|---|
Enqueue | O(1) | O(1) |
Dequeue | O(1) | O(1) |
Peek/Front | O(1) | O(1) |
Is Full/Empty | O(1) | O(1) |
Traversal | O(n) | O(1) |
Strengths:
Limitations: