摘要:
class Solution { public ListNode reverseList(ListNode head) { if (head == null || head.next == null) { return head; } ListNode preNode = null; ListNod 阅读全文
摘要:
//快慢指针public class Solution { public boolean hasCycle(ListNode head) { if (head == null || head.next == null) { return false; } ListNode fastNode = he 阅读全文
摘要:
public class Solution { public ListNode getIntersectionNode(ListNode headA, ListNode headB) { if (headA == null || headB == null) { return null; } Lis 阅读全文
摘要:
//将一个链表插入到另一个链表中class Solution { public ListNode mergeTwoLists(ListNode list1, ListNode list2) { if (list1 == null) { return list2; } if (list2 == nul 阅读全文