A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

What are advantages of linked data structures over arrays? What are its general disadvantages?

Linked data structures have always been counted on the usage of arrays since they have many advantages over arrays. Here we discuss about those advantages plus some general advantages of the linked data structures.

Advantages of Linked Data Structure over Arrays

Advantage #1:
– When you implement an array, a contiguous memory allocation is required which we can say is a rigid rule otherwise you won’t be able to declare an array.
– In linked data structures, if one element is located at a particular memory location, other one can be somewhere else. It becomes easy to find the elements exactly in order with the help of the pointers. Thus, you get more flexibility in the organization of the data and in allocation of the memory for it by using linked data structures.

Advantage #2:
– With arrays, you need to specify the size for it which if left un-used can lead to memory wastage and on the other hand sometimes it may prove to be insufficient for holding data.
– Linked data structures are declared dynamically and therefore are of the exact size as required by the program. Also before writing the program, there is no need to calculate how much space your program will need. This feature of the linked data structures helps in saving the memory from being wasted.

Advantage #3:
– The individual nodes in a linked data structure can be stored at different locations without having an effect on the logical link between the nodes.
– It is important that a process should take care while the nodes are being added or deleted from a linked data structure and other nodes are being processed by some other processes.
– If it is required to access a particular data record in a linked data structure, one needs to follow up a chain of pointers that are stored along with the data values.
– Suppose a linked data structure is having n number of nodes where each node has m number of links. There exist some nodes to which we cannot reach in logm n steps. There are possibilities that some complex structures might require like n-1 number of steps.
– On the other hand, in an array with a certain number of operations any element can be accessed.
– The number of operations thus required does not depend up on the number of entries in the array.

Linked data structures are implemented with the help of the dynamic data structures. It is because of this that the same memory space can be used again and again. This makes the utilization of the memory more efficient. Allocation is done as per the memory needs of the program and when that memory is no longer in use, it is de-allocated.

Disadvantages of Linked Data Structure

– Memory allocation overhead might be substantially incurred by the linked data structure which is one of its disadvantages.
– This happens usually when the allocation of the nodes has been done individually.
– The processor caching and memory paging algorithms often get upset because of this disadvantage.
– It is because of their poor reference locality.
– Some cases have been recorded where the amount of memory used by the linked data structures is more than what used by the array counterparts.
– This is because of the non – contiguous allocation of the linked data structures.
– Instances of the data are spread throughout the memory.
– In arrays, it is easy to access any element but in linked data structures, one has to follow multiple links.
– It leads to an increase in the time taken to access the element.
– Thus, we can say that the time taken to access the element is directly proportional to its location in the structure.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>