How do I get the newly added value of a queue?

assume that the queue is of fixed length 6 and will be dequeued at the same time
. For example, the queue is now 456849

if the original queue is 123456 and the new queue is 849
. < hr >

is there any algorithm that can quickly get the value of a new queue?

Jan.11,2022

you make it into a double-ended queue

Menu