How can we write a program to know whether a given linked list is circular or not . please reply me with the program
Q related to CLL
I won't write the program for you, but if you begin at the head, follow the links, and wind up back at the head, it's circular. If you run off the end of the world and dragons eat you (usually manifested by a NULL pointer), it's not circular. Tip: a simple pencil-and-paper representation of your problems is quite often effective. If you're not into destroying trees, an Etch-A-Sketch will do.
If you reach the head node while traversing the Linked list then you can safely assume its circular.