What is faster access the element in an array or in a list?

1 answer

Answer

1224816

2026-09-06 13:15

+ Follow

Array is always faster to read from disk/access any element in the array is quicker since elements in a array are stored in contiguous location in the memory, you need the pointer to the head or 0th element in the array and then it much quick to navigate to the next on index based. But you need to know INDEX of the element for best results

List (say linked list) will be slower since not always elements are stored in contiguous location in the memory as well it involves a function call which is can be assembler/cpu expensive.

However getting an individual object from an array is faster if you know the index of the object. Walking through a linked list is faster than walking through an array, if you use a non-recursive algorithm.

--Vinay Solanki

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.