public static bool HasCircle(Node<int> lst){ Node<int> curr = lst; if(curr == null) return false; bool flag = false; Node<int> temp = lst; while(curr != null && !flag) { while (temp != null && !flag) { if (temp.GetNext() == curr) flag = true; temp = temp.GetNext(); } curr = curr.GetNext(); temp = curr; } return flag;}