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

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b37ce6-2c0ca.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b37ce6-2c0ca.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?