摘要:
参考:https://www.cnblogs.com/kira2will/p/4109985.html 给定一个链表,要求你判断链表是否存在循环,如果有,给出环的长度,要求算法的时间复杂度是O(N), 空间复杂度是O(1). 1 public class CheckCircle { 2 public 阅读全文
摘要:
链表反转 public class ListReverse { static Node node1=new Node(); static { node1.data = 1; Node node2 = new Node(); node2.data = 2; Node node3 = new Node( 阅读全文