Linked List

Linked List in java is a set of two information. The first part contains the value and the second part consists of the reference of the next node. The first node is better known as the start node. The last node of it consists of null because the last node need not to refer to any node. It inherits the Abstract class and implements a list form. We can better denote it with a train, where start is the engine and the last node null value is the cross mark of the trains last compartment. LinkList allocates dynamically which results to consumption of space as well as time. Avoids haphazard storage of values.

Few points to be noted:
  • It can contain duplicate elements
  • It maintains order of insertion
  • It is a non-synchronized form
  • Scene there is no shifting so compiling time is less
  • It can either be used as a link-list, stack or queue
LinkList are of two types :
  1. Singly LinkList
  2. Doubly LinkList
Singly LinkList is a set of two parts one is the information part which stores the value inserted by user for the node and the other part is the reference part which refers to the next node. It is an one sided list. The first link is popularly known as start followed by the first valued node.

Doubly LinkList is the set consisting of three parts the first part contains the reference of the previous node, the second part consists of the info part inserted by the user and the third and the last part consists of the reference value referring to the next node available.
Method to declare a LinkList is: 
public class LinkedList extends AbstractSequentialList implements ListDequeCloneable, Serializable 

Share this

Related Posts

Previous
« Prev Post