Linked list provide an efficient way of storing related data and perform basic operations such as insertion, deletion and updating of information at the cost of extra space required for storing the address. Nodes in a linked array, insertions and deletions can be done at any point in the list in a constant time.Īnother advantage of a linked list over array is that, we can add any number of elements in the list, this is not possible in case of an array.įor example, if we declare an array as int a, then the array can store maximum of 10 data elements, but not even one more than that, there is no such restriction in case of linked list. Nodes in a linked list can be accessed only in a sequential manner. An array is a linear collection of data elements and a linked list is a linear collection of nodes.īut unlike an array, a linked list does not share its nodes in consecutive memory locations.Īnother point of difference between an array and a linked list is that a linked list does not allow random access of data.
0 Comments
Leave a Reply. |