Write a program that reads elements from a queue at random indexes.
Write a program that reads elements from a queue at random indexes.
Model answer
Generate a random index within the queue's size, then read that element. Reading by index does not remove the element, so the queue's size does not change.