Which statement about
ArrayList vs LinkedList in Java is correct?- aLinkedList gives O(1) random access via get(index), same as ArrayList.
- bArrayList gives O(1) random access via get(index), while LinkedList must walk the list node by node for get(index).✓
- cArrayList is a doubly linked list internally, so insertion at the head is O(1).
- dBoth classes store elements in a fixed-size array, so neither can grow beyond its initial capacity.
Explanation:ArrayList is backed by a resizable array, so get(index) is a direct array access — O(1). LinkedList is a doubly linked list, so get(index) must traverse from the head or tail depending on which is closer — O(n) in the worst case. Insertion at the head is cheap for LinkedList (O(1)) but expensive for ArrayList (O(n), shifting elements).