Name an advantage of array over linked list?
Answer Posted / sumeet choudhury
Arrays have random access and less overheads compared to
Linked list have sequential access only with too much
overheads and no cache memory support.
On the other hand, arrays allow random access, while linked
lists allow only sequential access to elements. Singly-
linked lists, in fact, can only be traversed in one
direction. This makes linked lists unsuitable for
applications where it's useful to look up an element by its
index quickly, such as heapsort. Sequential access on
arrays is also faster than on linked lists on many machines
due to locality of reference and data caches. Linked lists
receive almost no benefit from the cache.
Another disadvantage of linked lists is the extra storage
needed for references, which often makes them impractical
for lists of small data items such as characters or boolean
values. It can also be slow, and with a naïve allocator,
wasteful, to allocate memory separately for each new
element, a problem generally solved using memory pools.
| Is This Answer Correct ? | 64 Yes | 10 No |
Post New Answer View All Answers
What is multilevel inheritance explain with example?
What is difference between oop and pop?
What is abstraction in oop?
What is polymorphism what is it for and how is it used?
when to use 'mutable' keyword and when to use 'const cast' in c++
Why is oop better than procedural?
What is inheritance and how many types of inheritance?
program for insertion ,deletion,sorting in double link list
• What are the desirable attributes for memory managment?
What is encapsulation with real life example?
What is inheritance write a program to show use of inheritance?
i=20;k=0;
for(j=1;k-i;k+=j<10?4:3)
{
cout< write knight tour problem which is present in datastructure #include What is solid in oops?