In a case where the only operation being performed on a list is non-random access (no removals, additions, or other tom-foolery), would it be advisable to use an array, ArrayList, LinkedList, or something else? or is it irrelevant which is selected?
Share
Except in some specific situations (like embedded systems), you are likely working with a hierarchical and/or virtual memory system.
While the implementation details of this have been sufficiently abstracted by the operating system or hardware so that it is transparent to you, there are still some important considerations.
An array based implementation will exhibit a higher degree of spatial locality between elements than independently linked elements.
http://en.wikipedia.org/wiki/Locality_of_reference
Based on this, all other things being equal, I would choose ArrayList over LinkedList.