It sounds like a FIFO structure (First In First Out). You can only access the first element and you can only add new elements at the end.
For your case, you would simply need a while loop that check if it is not empty and if not it takes the first element and you can perform all the tests you described.