![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Linked List
DMilk
这个作者很懒,什么都没留下…
展开
-
LeetCode编程练习 - Merge Two Sorted Lists学习心得
题目: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 合并两个有序的链表,并返回新链表,新链表应该有这两个链表的头原创 2017-09-22 01:18:08 · 166 阅读 · 0 评论 -
LeetCode编程练习 - Remove Duplicates from Sorted List学习心得
题目: Given a sorted linked list, delete all duplicates such that each element appear onlyonce. For example, Given 1->1->2, return1->2. Given 1->1->2->3->3, return1->2->3原创 2017-09-22 01:31:22 · 153 阅读 · 0 评论 -
LeetCode编程练习 - Intersection of Two Linked Lists学习心得
题目: Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: A: a1 → a2原创 2017-09-22 01:42:09 · 166 阅读 · 0 评论 -
LeetCode编程练习 - Remove Linked List Elements学习心得
题目: Remove all elements from a linked list of integers that have valueval. Example Given: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6,val = 6 Return: 1 --> 2 --> 3 --原创 2017-09-22 01:47:23 · 186 阅读 · 0 评论 -
LeetCode编程练习 - Reverse Linked List学习心得
题目: Reverse a singly linked list. 反向一个单链表。 思路: 定义一个空值变量,遍历一个数,就将一个数赋值给这个变量,然后再将下一个指针赋值给这个空下来的位置,然后再将变量赋值给下一个指针,也就是a = b,b = c,c = a。 但是显示为空,后发现在定义下一个指针放在了循环外面,使得遍历不到链表中原创 2017-09-22 01:52:55 · 152 阅读 · 0 评论 -
LeetCode编程练习 - Palindrome Linked List学习心得
题目: Given a singly linked list, determine if it is a palindrome. Follow up: Could you do it in O(n) time and O(1) space? 给定一个单独对的链表,确定它是否是一个回文(顺读和倒读一样)。 思路:原创 2017-09-22 01:55:52 · 177 阅读 · 0 评论 -
LeetCode编程练习 - Delete Node in a Linked List学习心得
题目: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is1 -> 2 -> 3 -> 4 and you are given the third nod原创 2017-09-22 01:58:36 · 152 阅读 · 0 评论 -
LeetCode编程练习 - Linked List Cycle学习心得
题目: Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? 给定一个链表,在不使用额外空间下确定它是否有一个循环。 思路: 查看解决原创 2017-09-22 01:35:22 · 186 阅读 · 0 评论