Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Circular Queue with Fixed Capacity

Design a circular queue with fixed capacity k supporting enQueue x, deQueue, Front, Rear, isEmpty and isFull. enQueue and deQueue print true on success and false otherwise. Front and Rear print the element or -1 if the queue is empty. isEmpty and isFull print true or false.

Constraints

1 <= k <= 1000 At most 3000 operations

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.