Queue implementation using an array