A linked list is a series of elements, each containing a pointer or index to the next element in the list. You can dynamically add and delete elements in the list. An array is a contiguous block of repeated elements. Since each element is address-wise adjacent to the next element, there is no need for pointers or indexes to the "next" element. You can not dynamically add and delete elements in an array, although you can create "dynamic arrays" with (templates and) classes that auto-resize themselves. The STL does this for you, but it is a good exercise to implement it yourself.
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.
Use a linked-list.
for arrays you can list the different arrays and what attributes that you give to them.
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.
Memory Representation of Linear Linked List:Let LIST is linear linked list. It needs two linear arrays for memory representation. Let these linear arrays are INFO and LINK. INFO[K] contains the information part and LINK[K] contains the next pointer field of node K. A variable START is used to store the location of the beginning of the LIST and NULL is used as next pointer sentinel which indicates the end of LIST. It is shown below:
An array is a list of objects.A linked list is made up of nodes each containing a value then the pointer to the next node.Linked list exampleNode 1:dog,continued in node 4Node 2:undefinedNode 3:mouse,end of listNode 4:cat,continued in node 3Array example:dog,cat,mouse,pony,horse
LINEAR STRAIGHT CIRCULAR CURVED
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.
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.
I tried my best to explain all Linked List. For Single Linked List http://www.fansonnote.com/2012/02/single-linked-list/ For Double Linked List http://www.fansonnote.com/2012/02/double-linked-list/ For Multi Linked List http://www.fansonnote.com/2012/02/multi-linked-list/ Hope it will help. Thanks.
Linked lists use more memory than arrays, and finding an element in the list requires scanning the entire list instead of simply using a base pointer and index. As a result, linked lists are not well suited for data with a large number of elements. They are best used for a small number of elements that use a lot of space (relatively speaking).
Because the C programming language leaves the responsibility for memory allocation and pointers entirely with the programmer, the disadvantage of linked lists over some other linear data structures (such as arrays) is that the bear a risk or memory leaks and invalid pointers. The fact that the size of a linked list is generally not deterministic is also commonly viewed a disadvantage over statically linked linear containers (e.g. arrays) in some systems, primarily in embedded systems. Compared to containers of higher order (such as trees or hash tables), search operations in a linked list are generally slower. Compared to a double linked list, removal and insertion of items (except head and tail) is generally more expensive.