answersLogoWhite

0


Best Answer

I assume you are referring to implementation of Abstract Data Types like Stacks and Queues.

Arrays have capacity limits which you set upon declaring them. If you have date which has a definite size, then using arrays is okay.

But if you have data which size changes at runtime, then just use linked lists because linked lists could constantly add nodes whenever needed.

arrays need continuous memory allocation for their creation but in linked list the memory allocation need not be continuous....

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

16y ago

The similarities of the array and a linked list are few.

They are both structures that can hold data, and the type of data they hold is defined by the programmer.

However, an array is navigated by the index of the array, and the array is fixed in size at compile time.

The linked list is navigated by running up and down the 'next' and 'previous' pointers in the elements of the list. These pointers point to the next and previous elements inthe list, with the top and the bottom of the list being indicated by the previous pointer of the first element pointing to NULL (nothing comes before the first element) and the next pointer of the last element in the list pointing to NULL (nothing comes after the last element).

Linked lists can have elements removed. you make the next pointer of the element in the list BEFORE the one to be removed point to the element AFTER the one to be removed, and make the previous pointer of the element AFTER the one to be removed point to the element BERFORE the one to be removed.

That means no element points to the one to be removed, and then you free up the memory of the one to ber removed.

You can also add elements by allocating the memory for a new element, and you can insert it into the list at any point: start, end or middle, by fixing the pointers in the appropriate elements.

A linked list can contain many types of data in each element, depending on the structure of each element.

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

An array is a collection of similar objects in memory. A pointer is the address of an object in memory. If you wish, you may construct a collection of similar objects in memory. In that case, pointers and arrays are the same. In fact, as far as the compiler is concerned, the two semantics are the same, and most compilers convert one to the other. You can intermix the two conventions - they give the same results. For example, given that pa is a pointer to objects of type a, the expression a[13] is the same as *(pa+13) and vice versa. (In the simpler case, *pa is the same as a[0].) A pointer is an object, and it is an L-Value. You can change the contents of a pointer, such as with pa = &b, or with pa = malloc(27*sizeof(a)). An array's address, however, can not be changed. It is a R-Value. You may not say a = b. You must differentiate in your mind between the content of the pointer (its own value) and the contents of the memory (array) to which it points. They are two different things. Also, critically, arrays come pre-allocated, because you declare them to the compiler. Pointers must be initialized, by calling the appropriate allocation routine, such as malloc(), with later release of that memory with free().

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

Array implementation :

U 'd require an estimate of the maximum size of the list in the beginning. Searching for an element or printing the list will take linear time , but insertion and deletion r expensive .. n due to all this , simple arrays aren't the usual choice for implementing lists.

Linked List - Dynamic implementation :

The ad-hoc creation of nodes , fast deletion / insertion , efficient utilization of memory - the ideal choice for lists..

This answer is:
User Avatar

User Avatar

Ishara Silva

Lvl 2
2y ago

Array and LinkedList both are linear data structures.

Also,

add new elements

remove elements

find elements

print content

These basic operations can do using both array and the linkedlist

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

array and pointer both are derived datatypes..

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

Linklist is sorted, array not.

This answer is:
User Avatar

User Avatar

Anonymous

Lvl 1
3y ago

Similarities of array and linked list?

This answer is:
User Avatar

User Avatar

Anonymous

Lvl 1
3y ago

Similarities of array and linked list

This answer is:
User Avatar

User Avatar

Anonymous

Lvl 1
3y ago

hhh

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Comparison between array and dynamic implementation of linked list?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between dynamic implementation and linked list implemention?

The size or length of the list. For static, the size is a constant, while the size of a dynamic list may change over time. The 7 weekdays is static (in size/length, though the content is static as well), while the questions and answers at answers.com are 2 dynamic lists (the sizes are not constants, although just growing)


What are the differentiate between dynamic linking and dynamic loading?

Dynamic linking defers of the linking process until a program running or sometimes. It provides a variety of benefits that are hard to get otherwise- a. Dynamically linked shared libraries are easier to create that statically linked shared libraries. b. Dynamically linked shared libraries are easir to update than statically linked shared libraries.


When a direct comparison between two things unlike one another but considered essentially linked in some way?

metaphore


What is direct comparison between two things unlike one another but considered essentially linked in some way?

=This is called a Metaphor.=


What time required to insert element in stack with linked implementation?

O(1)


What is the difference between linked list and Ordinary list?

A list is an abstract data structure, usually defined as an ordered collection of data. A linked list refers to a specific implementation of a list in which each element in the list is connected (linked) to the next element.


Where linked list using?

linked list are used for creation of stack,queues to use memory in optimum manner linked list are used as they are dynamic in nature


What is a direct comparison between two things unlike one another but comsidered essentially linked in some way?

metaphor f**k apex


What is a direct comparison between two things unlike one another but considered essentially linked in some way?

=This is called a Metaphor.=


What Linked list uses.type of memory allocation?

Linked lists use dynamic memory allocation (also called "heap memory allocation", as the linked list is stored in heap memory).


How do you write a C plus plus program which involves polynomial addition and subtraction?

Polynomial addition and subtraction is a relatively straightforward process. You add or subtract coefficients of like order. This is a perfect example of a linked list, where the head of the list is order 0, the next element is order 1, and so on and so forth. Each element only needs one data item - the numeric coefficient. In C, you could do this as an ordinary linked list, or as an array, perhaps of dynamic size. In C++, you could create a polynomial class with operators to add and subtract, leaving the implementation details inside - it would no longer matter if it were a linked list, a dynamic array, or whatever. That is the beauty of encapsulation.


Implementation of queue?

Queues are commonly implemented for abstract routines and data access structures. In languages using object-orientation, they may be featured as classes. Some methods for implementation include circular buffers and linked tests.