×

Loading...

Let me try to answer the first one, based on my data stucture knowledge

1,

a,
The elements of an array are stored together in consecutive addresses;

The linked list members may be scattered in the variable area of the memory.

b,
Array allows you to access its elements randomly or consecutively; while no random access is available for linked lists' element.

c,
If you want to add new element into an array, you may probably use the "append" operation rather than "insert" --an insert-into-middle operation may take relatively long time;

You can insert an element into a linked list in any place of the list, without big trouble.

If you want to delete an element from an array --you caused a blackhole --or you have to spend big time to compress the array;

To delete elements from linked list, it's very simple and easy and it takes a almost contant time.

d,
To traverse the whole container, it's faster in an array.
Report

Replies, comments and Discussions: