Circular Singly Linked List program in Java

Circular Singly Linked List program in Java

In this post we will discuss about Circular Singly Linked List program in Java. Circular Singly Linked List is one of the complex data structures to understand.

Circular Singly Linked List

A linked list is a linear collection of data elements, called nodes pointing to the next node by means of a pointer. Nodes in a singly linked list are linked together using a next field, which stores the address of the next node. The last node in a singly linked list doesn’t point to any address. In case of circular singly linked list, the next field in the last node points to the first node thus forming a circle. Here is a pictorial representation.

Circular Singly Linked List program in Java

The circular singly linked list data structure can be implemented using multiple approaches. Here we will see two approaches of implementing circular singly linked list in Java.

Circular singly linked list– using recursion

Circular singly linked list– without recursion

Hope you find this post useful. If you have any doubts post it in the comments section.

The following two tabs change content below.
Working as a Java developer since 2010. Passionate about programming in Java. I am a part time blogger.

Add Comment

Required fields are marked *. Your email address will not be published.