I am not able to understand how to make a linked list which contain cycle?
How we can make a linked list which contain cycle
- you have to take one parameter (int m) value where cycle have to be created
- now iterate on linked list and if you get m then store it in a variable temp
- go to end of linked list set it pointer to m’s address store in temp rather than NULL
in this way you can create a cycle starting from m