This is what I have for it.
public class LLNode{ public String value; public LLNode next; public LLNode(String value, LLNode next){ this.value = value; this.next = next; } public String toString(){ if (next==null) return value; return value + ” ” + next.toString(); }}
Using the LLNode.java class I provide, write the followingmethods:
• public static boolean hasCycle(LLNode head)
Returns true if the linked list starting at head has a cycle (i.e.its tail points to another node
in the list instead of null).
Hint: There’s a data structure very
PayPal Gateway not configured
PayPal Gateway not configured