A great lathe operator commands several times the wage of an average lathe operator, but a great writer of software code is worth 10,000 times the price of an average software writer. Bill Gates

Detect and Remove Loop

Language Java | Level Intermediate | Category Data structure | September 5, 2015 11:57 pm


Data structure Description

The singly linked list contains a sequence of nodes which each node contains data and link to the next node. The last node points to the null value. Write a program to detect and remove the loop in the singly linked list. If the linked list does not contain any loop or cycle, print the appropriate message.


Output

   					 

Linked List: 101-->201-->301-->401
Linked List is not cyclic, no loop or cycle found

				    

Comments


No comments available!

Please login to add comments.