Given a set of integers can we form a linked list with cycle ? How so?
Let’s say you are given: 1 2 3 4 5 2 3, how do you keep track as to where to form the node, and if there are multiple cycles.
In the given case, the possibilities can be:
1->2->3->4->5->2->(3->4->)…
and 1->2->3->4->5->(2->3->4->)…
Kindly help;
Further kindly share code;