Array functions, stack and queues