Educational Methods and Theories

What are the advantages of linked lists?

User Avatar
Wiki User
2007-08-09 00:14:10

The biggest advantage of linked lists is that they can be

expanded in constant time without memory overhead.

For example when you make an array you must allocate memory for

a certain number of elements. If you want to add more elements to

the array than you allocated for you must create a new array and

copy the old array into the new array. This can take lots of time.

You can prevent this by allocating lots of space initially but then

you might allocate more than you need wasting memory.

With a linked list you can start with space for just one element

allocated. And add on new elements easily without the need to do

any copying and reallocating.

Copyright © 2020 Multiply Media, LLC. All Rights Reserved. The material on this site can not be reproduced, distributed, transmitted, cached or otherwise used, except with prior written permission of Multiply.