What is an array? What is the advantage of linked-list over array?

  
Showing Answers 1 - 9 of 9 Answers

Anjaki

  • Feb 2nd, 2006
 

Array is a collection of similar entities like integers, float etc. Its syntax is int arr[] that  is, array is of int datatype. They store the variables in contiguous memory locations. The advantage of linked list lies in its flexibility in assigning memory locations. The element stored in linked list need not to be in contiguous memory locations.Hence,memory can be utilized efficiently.

  Was this answer useful?  Yes

kausik ray

  • Mar 3rd, 2006
 

Array is a set of memory location in the user memory(RAM).adv. of linked list over array: 1. linked list is created by the dynamic memory alocation. Where as array is created by static memory allocation. So in linked list the memory space is properly utilised & in array the unused memory spaces are wasted.2. in linked list at any positon insertion,deletion of a node can be done. But in array insertion 7 deletion can be done on the end of an array.

  Was this answer useful?  Yes

Technically, considering the antenna terminology an antenna array is collection of similar antennas oriented similarly to get greater directivity in desired direction.Therefore, an array can be defined as collection of memory locations.The advantage of linked list over array is in linked-list the information is not stored in random memory locations as in array so, there is no wastage of memory in an linked-list compared to array.Therefore,linked-list has advantage of good memory management over array.

  Was this answer useful?  Yes

laxman

  • Jul 28th, 2006
 

In array we can insert or delete an element in the list , and run time memory allocation is not possible in the arrays,we can add memory and delete memory allocations.in arrays it is not possible to store large amount of data where it is possible withlinked list.

  Was this answer useful?  Yes

sunil kumar

  • May 8th, 2007
 

Array is a collection of homogenious data elements stored in continuous memory locations.

In array we have a direct access to any element but in linklist to access any element we have to begin from the start node.

Bijoy kumar Baral

  • May 17th, 2007
 

An Array is an collection of data elements of similar type.
Arrays are fixed-length structures for storing multiple values of the same type. An array implicitly extends java.lang.Object so an array is an instance of Object.
But arrays are directly supported language features.


Linkedlist is the ordered collection of data elements not in similar types.
Linked list implementation of the List interface,the LinkedList class provides uniformly named methods to get, remove and insert an element at the beginning and end of the list,Linked list implementation can't be synchronized

  Was this answer useful?  Yes

shmlbbt

  • Aug 30th, 2008
 

If you want to insert or remove element from the end, use arraylist. But adding or removing an element from the middle is expensive because the reminder array should be copied one step backward or forward. But this is very easy in a linked list because just need to change the link.

Getting an element from the array list is very easy, but from a linked list is difficult because you have to start searching from the first node and travers through each and every node.

Array:- Array is an collection of similar data types.

Advantage of link list:

1) First in the Array is compile time address binding. It means it allocate memory space for an array at compile time. So we can not add more element than the size of array at run time. In array size is fixed so if we use memory less than size then space will be wasted. In another way Linked list is Run time address binding. In linked list there is no waste of memory. User can use memory as he needed. In another way linked list is collection of non-similar data types. So it can stores non-similar data.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Answer Question

Click here to Login / Register your free account


 
Send   Reset

 

Related Answered Questions

 

Related Open Questions