ArrayList vs LinkedList efficiency

Viewed 2218

I have a problem which uses many insertions in the list at the beginning and afterwards search and retrieval operations are extensively used, So which approach is good and efficient?

Approach 1: Use LinkedList as my data structure for the whole program.

Approach 2: Use ArrayList as my data structure for the whole program.

Approach 3: Use LinkedList as my data structure at the beginning for insertion and do Arraylist al = new Arraylist(ll); for retrieval operations.

How much does the changing of data structure cost?? Is it actually worth doing it?

3 Answers
Related