Solution
= Solution
With that display format the output is
``
20
10
10
Queue status: [30, 40, 15]
``
The first removal takes the newly prepended left value $20$. The right removal later takes the most recently appended $10$. The next left removal takes the earlier $10$, leaving the ordered <sequence> \b[$\langle30,40,15\rangle$]. The two equal values are different occurrences, and the displayed order follows the links rather than numerical sorting.