Sei sulla pagina 1di 4

http://iampandiyan.blogspot.in/2014/10/array-based-implementation-of-list-adt.

html
What is Linked LIST?
A linked list is a data structure consisting of a group of nodes which together represent a
sequence. Under the simplest form, each node is composed of a data and a reference
(in other words, a link) to the next node in the sequence. Link is a pointer to next node.

Type declaration for linked list::

Node ::

It represents a structure of node;


It contains element and reference/Poi

nter to next node.


Advantages of Linked List::

1. Linked LIST is dynamic data structure.

2. Linked LIST can grow and shrink during run time.

3. Insertion and deletion operation are easier.

4. Efficient Memory Utilization, i.e no need to pre-allocate memory.

Disadvantages of Linked List::

1. Pointer requires extra memory for storage.

2. No random access. In array if we want to access the nth element, we can access by
array[n]. But in Linked LIST, we need to traverse n times .
What are the types of Linked List?
Singly Linked List

Types of linked lists are ... In an array implementation, read pointer as index.

Singly linked - there is a head pointer, and one next pointer per element. The last
element's pointer is null. This type of list can be traversed in only one direction.

Doubly linked - there is a head pointer, and each element contains two pointers, one to
the previous element and one to the next element. This type of list can be traversed in two
directions, making insertion and deletion a bit easier, at the cost of extra memory.

Circularly linked - the same as Singly or Doubly linked, except that the last element's
pointer points back to the first element's pointer. These types of lists are often used as
queues.

Potrebbero piacerti anche