博客专栏  >  编程语言   >  Link

Link

链表相关算法

关注
0 已关注
14篇博文
  • 链表相关算法

    在O(1)时间删除链表结点从尾打印到头链表中倒数第k个节点删除链表中值重复的节点往链表末尾插入节点,删除链表中含有某个值的节点21. Merge Two Sorted Lists160. Inters...

    2018-03-12 21:18
    32
  • 删除链表中重复的结点

    题目:在一个排序的链表中,如何删除重复的结点void DeleteDuplication(ListNode** pHead) { if(pHead == nullptr || *pHead =...

    2018-03-17 00:14
    40
  • 往链表末尾插入节点,删除链表中含有某个值的节点

    void AddToTail(ListNode ** pHead,int value) { ListNode * pNew=new ListNode(); pNew-&am...

    2018-03-12 21:30
    29
  • 在O(1)时间删除链表结点

    void DeleteNode(ListNode** pListHead, ListNode* pToBeDeleted) { if(!pListHead || !pToBeDeleted) ...

    2018-03-04 18:38
    34
  • 从尾打印到头

    非递归方法://从尾到头输出链表 int ListReverse(ListNode *head){ stack<int> stack; List...

    2018-03-04 18:54
    19
  • 链表中倒数第k个节点

    tNode* FindKthFromTail(ListNode* pListHead,int k) { if (pListHead == NULL || k == 0)//防止空的链表 和 k值 ...

    2018-03-04 16:46
    35
  • 21. Merge Two Sorted Lists

    Merge two sorted linked lists and return it as a new list. The new list should be made by splicing t...

    2018-03-01 21:20
    24
  • 160. Intersection of Two Linked Lists

    Write a program to find the node at which the intersection of two singly linked lists begins.For exa...

    2018-03-01 21:23
    19
  • 142. Linked List Cycle II

    Given a linked list, return the node where the cycle begins. If there is no cycle, return null.Note:...

    2018-03-01 21:50
    33
  • 141. Linked List Cycle

    Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extr...

    2018-03-01 21:53
    30
  • 86. Partition List

    Given a linked list and a value x, partition it such that all nodes less than x come before nodes gr...

    2018-03-01 22:11
    29
  • 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...

    2018-01-28 19:16
    66
  • 138. Copy List with Random Pointer

    A linked list is given such that each node contains an additional random pointer which could point t...

    2018-01-28 20:06
    39
  • 206. Reverse Linked List

    class Solution { public: ListNode* reverseList(ListNode* head) { if (head == NULL || hea...

    2018-03-01 20:17
    42
img博客搬家
img撰写博客
img发布 Chat
img专家申请
img意见反馈
img返回顶部