answersLogoWhite

0

An array is a consecutive chunk of memory with a fixed size that can be accessed directly and randomly.

A linked list has no fixed size (it can grow or shrink) and does not fit in a block of memory the way an array does.

Depending on your usage requirements either might be better than the other. If you require fast, random, direct access to an element and don't have to worry about changing the size of a list than an array may work out better for you than a linked list.

If you don't know the maximum number of elements in your list, or it can grow or shrink, and you don't need to access any elements directly or randomly in a frequent manner, than perhaps the linked list will work out better for you.

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

What is the difference between array linklist?

Linked list consists of data nodes each pointing to next in the list .An array consist of contiguous chunk memory of predetermined size


What is the difference between sequential allocation and linked allocation in java?

Sequential allocation refers specifically to arrays. An array is, by definition, a contiguous block of memory. The index of the array is used as an offset from the memory address of the beginning of the array - this is why access to any element in an array takes a constant amount of time to compute. "Linked allocation" is best described by linked lists. These data structures are connected by a series of nodes. A node contains at least two pieces of information: some piece of data and a reference (link) to the next node in the chain. Since changing the position of a node in a linked list only requires changing references to other nodes, insertion and deletion is trivial. Note that these "referential" linked data structures are not the only way to link data, just the easiest to understand and implement.


What is the difference between LinkedList and Hashtable?

A linked list is made up of a sequence of connected (linked) nodes. A hashtable is usually backed by an array, and is an association of keys and values. When an object is added to the array it becomes a value; the object is hashed to get a key (an index into the array).


Is it true or false that a dynamically linked list can be accessed both sequentially and randomly?

No. Linked lists require traversal, and are therefore accessed sequentially. For random access you need an array. An array of pointers to the data in your list would do, but you will incur an overhead in creating the array on top of the list.


What is the difference between a PAL and a PLA?

PLA is programmable logic array while PAL is Programmable Array Logic. PLA is a kind of programmable logic device used to implement combinational logic circuit. It has Programmable AND Gate linked with Programmable OR Gate. PAL is an combinational PLD that was developed to overcome certain disadvantage of PLA. PLA shows longer delay due to additional fusible links which results from using two programmable array and increase circuit complexity. Thus, PAL is used which is less complex and fast to implement. PAL consists of programmable AND linked with fixed OR.

Related Questions

What is the difference between array linklist?

Linked list consists of data nodes each pointing to next in the list .An array consist of contiguous chunk memory of predetermined size


What is the difference between queues and circular queues?

A queue can use a dynamic array, or a linked list, but if using static memory, the queue becomes a circular queue because the underlaying data structure is a static circular array. This means the ends of the array are attached.


Comparison between linked and array lists?

The difference between linked and array lists is in how they are stored. Arrays are a predefined block of memory into which information is stored or recalled. Any data element from an array can be retrieved in O(1) time. But if you need to increase the size of the array, you would need to create a new one and copy the contents of the old one into it. Linked lists are usually dynamically allocated during run time, and the only way to get to a node (a data element) is to traverse the list until you find it which makes the retrieval time slower O(n) . The benefit of a linked list is that you can insert new data elements without having to copy or move all the elements in the list as you would in an array. The linked list is better for large databases that need to add and remove items often, whereas arrays are better for list sizes that generally don't change.


Can you simulate linked list using arrays?

I would say no, but it really depends on your point of view. An array and a linked list can both hold the same data; the only difference is how they do so. The definition of a linked list is a sequence of connected nodes. An array is a contiguous block of memory, so you can think of an array as a linked list in which each element is spacially connected to the next.


What is the difference between numeric array and associative array?

Numeric array has numbers(+integers) that represent the values Associative array has strings that represent the values


What is the difference between array and string of array?

When we declare an array of characters it has to be terminated by the NULL , but termination by NULL in case of string is automatic.


Difference between vector and array list?

Vectors are thread safe but array lists are not. Hence array lists are faster than Vectors.


What is the minimum absolute difference between any two elements in a given array?

The minimum absolute difference between any two elements in a given array is the smallest positive number that can be obtained by subtracting one element from another in the array.


What is the difference between a Magician and a Chorus Line?

A Magician has a cunning array of stunts ...........................................................................


What is Difference between programmable logic array and programmable array logic?

Using and gate - pla is programmable while pal is fixed


Can a linked list implemented using an array be accessed by giving the location?

A linked list implemented with an array defeats the purpose of using a linked list, which is to address the memory allocation problems associated with arrays.


What is the difference between sequential allocation and linked allocation in java?

Sequential allocation refers specifically to arrays. An array is, by definition, a contiguous block of memory. The index of the array is used as an offset from the memory address of the beginning of the array - this is why access to any element in an array takes a constant amount of time to compute. "Linked allocation" is best described by linked lists. These data structures are connected by a series of nodes. A node contains at least two pieces of information: some piece of data and a reference (link) to the next node in the chain. Since changing the position of a node in a linked list only requires changing references to other nodes, insertion and deletion is trivial. Note that these "referential" linked data structures are not the only way to link data, just the easiest to understand and implement.