你会如何实现,你用了多长时间?
Problem statement:
Design and implement a CIRCULAR buffer for integers. A circular buffer
contains a FIXED number of slots for storing integers and acts like a
FIFO
queue. New entrants to the queue are added at the END of the buffer.
Delete
removes from the HEAD of the queue. Implement operations to add,
delete,
compare (comparing two such queue objects), and find. Make the code
robust
and consider edge cases. Assume that CONCURRENT access to the buffer is
possible.
Please implement it in Java.