It is not possible to add the new link because it would replace an existing, longer link.
Line 1: | Line 1: | ||
===General disadvantages=== |
===General disadvantages=== |
||
Linked data structures may also incur in substantial [[dynamic memory allocation|memory allocation]] overhead (if nodes are allocated individually) and frustrate [[ |
Linked data structures may also incur in substantial [[dynamic memory allocation|memory allocation]] overhead (if nodes are allocated individually) and frustrate [[memory paging]] and [[cache (computing)|processor caching]] algorithms (since they generally have poor [[locality of reference]]). In some cases, linked data structures may also use more memory (for the link fields) than competing array structures. This is because linked data structures are not contiguous. Instances of data can be found all over in memory, unlike arrays. |
||
In arrays, nth element can be accessed immediately, while in a linked data structure we have to follow multiple pointers so element access time varies according to where in the structure the element is. |
In arrays, nth element can be accessed immediately, while in a linked data structure we have to follow multiple pointers so element access time varies according to where in the structure the element is. |