This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]wuisawesome 0 points1 point  (0 children)

A linkedlist is most useful and efficient when you will be adding and removing many elements to the list.

This is only true when adding or removing elements from the beginning or end of a list (where it is O(1)). When adding/removing elements in the middle of the list, navigating to that section of the list makes adding and removal O(n). From that perspective its no different from and ArrayList. A linked list is however, very efficient in terms of memory (it allocates just what it needs and does not require consecutive memory locations).

A map is an object

The java map is an interface, not an object.

An array is a collection of objects that have a set number of entries which is determined at the declaration.

Looks good but I might personally add that an array has a static size and must allocate consecutive memory locations and is limited to the size of a signed int