You could definitely use two indexes instead of a queue, and using indexes over an array will be faster than using a queue.
You could definitely use two indexes instead of a queue, and using indexes over an array will be faster than using a queue.