If you are trying to get the best performance, use ArrayDeque or arrays: running a million elements through it will take only a few milliseconds. It is what you do with the elements that will take most of the time.
2 Likes