LinkedList , . , .
Inserting into an ArrayList is a little more expensive if the number of elements in the ArraList already has the size of the class array. This will mean that he will have to create a new array and copy the elements. In addition, it has direct access to the last element, which makes it very easy to add and remove elements.
PS you can also consider using the stack. Not sure about your requirements, but just like a sentence.
source
share