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

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

2018-03-12 21:18
16

3天前 00:14
13
• #### 往链表末尾插入节点，删除链表中含有某个值的节点

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

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

非递归方法：//从尾到头输出链表 int ListReverse(ListNode *head){ stack&amp;lt;int&amp;gt; stack; List...

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

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

2018-03-04 16:46
24
• #### 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
16
• #### 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
12
• #### 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
21
• #### 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
21
• #### 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
22
• #### 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
62
• #### 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
35
• #### 206. Reverse Linked List

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

2018-03-01 20:17
34