美文网首页
LeetCode题集-链表

LeetCode题集-链表

作者: 01_小小鱼_01 | 来源:发表于2018-04-09 23:02 被阅读5次

    链表逆序

    206. Reverse Linked List

    /**
     * Definition for singly-linked list.
     * public class ListNode {
     *     int val;
     *     ListNode next;
     *     ListNode(int x) { val = x; }
     * }
     */
    class Solution {
        public ListNode reverseList(ListNode head) {
            
        }
    }
    

    92. Reverse Linked List II

    Reverse a linked list from position m to n. Do it in-place and in one-pass.
    For example:
    Given 1->2->3->4->5->NULL, m = 2 and n = 4,
    return 1->4->3->2->5->NULL.
    Note:
    Given m, n satisfy the following condition:
    1 ≤ m ≤ n ≤ length of list.

    /**
     * Definition for singly-linked list.
     * public class ListNode {
     *     int val;
     *     ListNode next;
     *     ListNode(int x) { val = x; }
     * }
     */
    class Solution {
        public ListNode reverseBetween(ListNode head, int m, int n) {
            
        }
    }
    

    求两个链表的交点

    链表的节点交换(LeetCode 24. Swap Nodes in Pairs)

    链表求环(LeetCode 141,142. Linked List Cycle 1,2)

    链表重新构造(LeetCode 86. Partition List)

    复杂的链表复制(LeetCode 138. Copy List with Random Pointer)

    排序链表合并(2个与多个) (LeetCode 21,23 Merge Two(k) Sorted ListsLeetCode)

    相关文章

      网友评论

          本文标题:LeetCode题集-链表

          本文链接:https://www.haomeiwen.com/subject/iegoaxtx.html