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

Design Circular Deque

Design a deque of capacity k backed by a ring. Operations: insertFront x, insertLast x, deleteFront, deleteLast, getFront, getRear, isEmpty, isFull. Insert and delete print true or false for success; getFront and getRear print the value or -1 when empty.

Constraints

1 <= k <= 1000 At most 2000 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.