linear time we are gonna have to manage those in a slightly non naive but, but pretty straightforward way namely via a queue, which is a first in first out data structure that I assume you have seen. 