摘要:
class Solution { public ListNode reverseList(ListNode head) { if (head == null || head.next == null) { return head; } ListNode preNode = null; ListNod 阅读全文
posted @ 2023-07-20 17:15
Hi,Bro
阅读(8)
评论(0)
推荐(0)
摘要:
//快慢指针public class Solution { public boolean hasCycle(ListNode head) { if (head == null || head.next == null) { return false; } ListNode fastNode = he 阅读全文
posted @ 2023-07-20 16:32
Hi,Bro
阅读(8)
评论(0)
推荐(0)
摘要:
public class Solution { public ListNode getIntersectionNode(ListNode headA, ListNode headB) { if (headA == null || headB == null) { return null; } Lis 阅读全文
posted @ 2023-07-20 16:14
Hi,Bro
阅读(7)
评论(0)
推荐(0)
摘要:
//将一个链表插入到另一个链表中class Solution { public ListNode mergeTwoLists(ListNode list1, ListNode list2) { if (list1 == null) { return list2; } if (list2 == nul 阅读全文
posted @ 2023-07-20 15:26
Hi,Bro
阅读(21)
评论(0)
推荐(0)