Monday 22 August 2011

Linked List

Introduction to Linked List

Prerequisite for Linked list: you should know about Pointers and Dynamic Memory Allocations (new, delete operators),  Self Referential Class   and generic classes or classes


Definition of Linked list
It is a collection of nodes is called Linked List. It is used to create tree, graph and other abstract data types.

What is node?
A node is an object which contains the data field and the link field (pointer).
  • Here Data field contains the value, Link field contains the address of next node.
  • Each node consists two data members. (1) data variable (2) pointer variabe
  • Data variable stores value, it may be numbers or characters
  • Pointer variable (link field) stores the address of the next node
In which situations we use Linked List:

Linked Lists are very useful in many situations where the application (prog) demands to organise memory very carefully and a contiguous memory block is not needed.

You may like the following posts:
1. Difference between Linked List and Arrays
2. Advantages of Linked List
3. Disadvantages of Linked List 
4. Some terminology of Linked List programs


Types of Linked list

No comments:

Post a Comment