In reply to NiLu:
One other point I forgot to mention was the cost of accessing individual elements. A queue is designed for easy access to its head(first) and tail(last) elements. Accessing an element by index requires traversal of the queue. So you might be better off making the input and output of your function dynamic arrays. SystemVerilog can pass dynamic arrays to queues and back quite easily as long as the elements are the same type. I assume your actual function is much more complicated that what you have shown, so this might be a better option.