2016年9月4日

[LeetCode]206. Reverse Linked List 解题小结

摘要: 题目: Reverse a singly linked list. click to show more hints. Hint: A linked list can be reversed either iteratively or recursively. Could you implement 阅读全文

posted @ 2016-09-04 16:54 医生工程师 阅读(104) 评论(0) 推荐(0) 编辑

[LeetCode]203. Remove Linked List Elements 解题小结

摘要: 题目: Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 阅读全文

posted @ 2016-09-04 10:51 医生工程师 阅读(139) 评论(0) 推荐(0) 编辑

[LeetCode] 83. Remove Duplicates from Sorted List

摘要: 题目: Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1->1->2->3 阅读全文

posted @ 2016-09-04 10:19 医生工程师 阅读(144) 评论(0) 推荐(0) 编辑

[Leetcode]141. 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? 让head不断走一步,如果cur不为null,走两步,这样如果存在cy 阅读全文

posted @ 2016-09-04 09:29 医生工程师 阅读(71) 评论(0) 推荐(0) 编辑

导航