Circular Linked List

Sandhya Reyya
2 min readNov 25, 2020

--

Circular Linked List is just like double linked list, where there are 2 pointers (prev & next) in a node. One pointer(next) refers the address of next data item and the other pointer(prev) refers the address of previous data item. The only difference is, head’s prev refers to the address of last data item and last’s next refers the address of first data item. It is just like linking 2 ends of a double linked list.

The terminology used in circular linked list is same as double linked list:

  1. head: It refers the address of first data item.
  2. last: It refers the address of last data item.
  3. prev: It stores the address of the previous data item.
  4. next: It stores the address of the next data item.
  5. data item: It stores the data in the memory.
  6. node: The combination of prev, next, and data item.

Like double linked list, circular linked list can move in both forward and backward directions .

Representation of Circular Linked List:

Insertion: It inserts at the end of the circular linked list. The address in head’s prev and last get changed to new node’s address.

Deletion: It removes the last node from the circular linked list.

Search: This operation helps to search a key in a circular linked list.

Traversal: It displays all the elements in circular linked list either in forward direction from head or in backward direction from last.

Now let us see the programs of Circular Linked list:

  1. C

2. Java

With this we have completed Linked Lists.

Next story is about stacks and their operations.

Thank you.

--

--

Sandhya Reyya
Sandhya Reyya

No responses yet