I return a List from my A
class. I would like to remove the first element from the list and add it as the last element to the same list. I did it this way.
myList.add(myList.get(0));
myList.remove(0);
The target hardware is Android OS. Should I code my A
class in a way that it returns an ArrayList
, or a LinkedList
? Which would be better for the following scenarios:
myList has always 100 elements
myList has always 10 elements
Maybe I see a problem where there is none. Do you think I shouldn't care for performance in this case, since the problem size is (for both 1 and 2) is small?
I am aware of the saying "premature optimisation is the root of all evil". That's why I am hesitating before changing my implemantation (as for now, my A
object returns an ArrayList).