1

Which is better used for cache based application among Arraylist or Linkedlist and why?

1 Answer 1

1

You'll want to use the ArrayList. More often than not, there is a better alternative to using a LinkedList, though there are scenarios where LinkedLists are the right choice.

Why? LinkedLists use many small chunks of memory, which ends up offering very poor performance due to cache's utilization of locality.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.