If the list contains n elements, the Big-O of operations is as follows:
| Method | ArrayList | LinkedList |
| get, set ith | O(1) | O(n) |
| ... at front or end | O(1) | O(1) |
| add, remove ith | O(n) | O(n) |
| ... at front | O(n) | O(1) |
| ... at end | O(1) | O(1) |
| ... in ListIterator | O(n) | O(1) |
| contains | O(n) | O(n) |
To choose the best one, you need to understand which methods you will use.
Contents    Page-10    Prev    Next    Page+10    Index